Very Simple Question about Special Functions

 

So my understanding is that OnStart() is where you put trading algorithm for opening and closing positions

but any changes in the currency pairs price during the execution of OnStart() are ignored.


If, then, how would I set it such that once the positions are opened, my closing algorithm would monitor current price changes

until optimal exit condition is met, and exits?

 
when orders total is >0 above zero.
 
Kevin Kim:

So my understanding is that OnStart() is where you put trading algorithm for opening and closing positions

but any changes in the currency pairs price during the execution of OnStart() are ignored.


If, then, how would I set it such that once the positions are opened, my closing algorithm would monitor current price changes

until optimal exit condition is met, and exits?

use 

1) OnTick()

or

2) RefreshRates() 

 
Kevin Kim:

So my understanding is that OnStart() is where you put trading algorithm for opening and closing positions but any changes in the currency pairs price during the execution of OnStart() are ignored.

If, then, how would I set it such that once the positions are opened, my closing algorithm would monitor current price changes until optimal exit condition is met, and exits?

  1. OnStart is only for scripts, OnTick is for EAs
  2. Correct.
  3. Scripts: Sleep, RefreshRates, and retest. EAs, return and retest on next tick.