A solution more efficient than using a TMF or tick() would be to use a more granular BarPeriod (say, 1-min) and use TimeFrame=30 to build your "decision" price/indicator (MA) series.

priceClose(0) will then be a close of 1-min bar and you can check for the exit condition right in the run().


There might be some value in waiting for the close of a 30-min bar to crossover the MA before exiting a trade, but if you really, really want to close it "on-the-line" (and 1-min bar crossovers are not enough),
then just set/adjust TradeStopLimit=MA (in a trade loop).

Zorro will monitor the trade and exit accordingly.

Last edited by Zheka; 02/14/21 15:42.