ExitAtStop in Forex ignored?
Author: ecorderob
Creation Date: 5/1/2012 11:22 AM
profile picture

ecorderob

#1
Hi, I am trying to test some system in the EUR/USD pair (5 min) and I want to set one stoploss order so that it would exit the trade if price goes against me in 15 pips.

I have tried:

CODE:
Please log in to see this code.


But it seems it just ignores the stop.

Any idea what am I doing wrong?

Thanks,
-Enrique
profile picture

Eugene

#2
If you want Alerts, change the bar to bar+1.
If you need to exit a short trade, you need to change the "-" sign to "+".
profile picture

ecorderob

#3
I want to exit a long trade if the price goes against me, so I guess it should be "-", but it just ignores it.
profile picture

Eugene

#4
Please be more specific with regard to your code, for now it's only guesswork.
profile picture

ecorderob

#5
This is the code...

CODE:
Please log in to see this code.


By the way, there is something wrong. Look at this image:

profile picture

Cone

#6
You need to set up your Forex symbols in the Symbol Info Manager and turn on Futures Mode. That way the significance behind the decimals will not be lost when rounding to the "Tick" value.

Doing that should make things work fine, but if you still intermittently see trades that don't execute when you expect, go to Preferences (F12) > Backtest Settings and "Turn off limit/stop order rounding entirely".
profile picture

ecorderob

#7
Ok, thanks! Now it seems better :)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).