Hello,
I'm testing my first simple EA. It opens an order with a stop loss some pips above the high. I would expect if in the next bar the stoploss level is exceeded it would close the order. Much like it closes the order when a takeprofit target is reached. But the stop loss does not work like I expected in the tester.
The code I use for opening is:
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+ISL*Point,Bid-TakeProfit*Point,"WDOWF",16384,0,Red);
where ISL stands for Initial Stop Loss and is for instance 50.
Why is the stop loss not triggered?
Thanks,
PvO
What does the journal say?
There are no numbers on your chart. Who can tell?
Hello Phy,
In this example you see two sell orders being opened. The fiist is closed the next 4 hour bar though this bar does not exceed the stoploss level.
The second order is not closed though several closings exceed the stoploss level, so I expected it to be closed.
If you need more information please ask.
Thanks,
Piet
Post your code for examination.
Well, I've been messing it up. Maybe my code prohibited the execution of the stoploss. I think I will start all over again because it is such a mess now. If it happens again I will post again including code. Thanks for now.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I'm testing my first simple EA. It opens an order with a stop loss some pips above the high. I would expect if in the next bar the stoploss level is exceeded it would close the order. Much like it closes the order when a takeprofit target is reached. But the stop loss does not work like I expected in the tester.
The code I use for opening is:
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+ISL*Point,Bid-TakeProfit*Point,"WDOWF",16384,0,Red);
where ISL stands for Initial Stop Loss and is for instance 50.
Why is the stop loss not triggered?
Thanks,
PvO