How set a time limit on buystop/sellstop?

Discussion in 'Automated Trading' started by ww11, Jul 29, 2015.

  1. ww11

    ww11

    The followings are what I want:

    1) To set a Buystop/Sellstop/Shortstop/Coverstop for autotrading (amibroker) , for example, 5 ticks.

    2) If the above-mentioned rule doesn't happen in 30 seconds, then no trade is made until next trade signal occurs.

    Example:

    According to strategy A, it is time to enter a trade. The price now is 4500. 5 ticks means 4500 to 4505. However, the price moves up very fast so that the system is not able to enter the trade in the price range. Also, the price doesn't move back to the range within 30 seconds. In this situation, the system enters no trade and wait until next entry signal.

    Would anyone help and write the code? Thanks a lot!