Forums › ProRealTime English forum › ProOrder support › Break even coding › Reply To: Break even coding
05/29/2018 at 11:12 PM
#71653
Your code can be abridged like that
1 2 3 |
if longonmarket and close-tradeprice>=400 then sell at tradeprice stop endif |
for SHORT trades
1 2 3 |
if shortonmarket and tradeprice-close>=400 then exitshort at tradeprice stop endif |
This code will work for DAX. S&P500 and other instruments, but not for FX pairs, since 400 will never be reached by any currency!!!! You should use 400*pipsize to make your code portable to all instruments.