Download MetaTrader 5
To add comments, please log in or register
Do you have a trading signal? Publish it in your blog as well!
Kevin Kim
35
Kevin Kim 2016.10.26 08:34 

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?

Marco vd Heijden
Moderator
4505
Marco vd Heijden 2016.10.26 12:18  
when orders total is >0 above zero.
Fstrifoerr8
36
Fstrifoerr8 2016.10.28 22:50  
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() 

whroeder1
14236
whroeder1 2016.10.28 23:05  
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.
/
To add comments, please log in or register