Download MetaTrader 5
To add comments, please log in or register
Examine the Top MetaTrader 5 signals. Choose the best one and subscribe to it!
Bruno
7
Bruno 2014.07.18 17:52 

I don't know if this is standard procedure and the test can't use stop losses, but I found no way to use them in the strategy tester.


I tried both the following code, but the stop loss get's completely ignored:

int slippage = 10;
double stoploss = 0.0001;
int MagicNumber = 123;

ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, slippage, stoploss, 0., "sell", MagicNumber, 0, Lime);
int slippage = 10;
double stoploss = NormalizeDouble(0.0001, digits);
int MagicNumber = 123;

ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, slippage, stoploss, 0., "sell", MagicNumber, 0, Lime);


Any ideas?

whroeder1
13656
whroeder1 2014.07.18 17:59  
double stoploss = 0.0001;
  1. Tester is irrelevant.
  2. The SL price must be above the Ask for a sell.
  3. What are Function return values ? How do I use them ? - MQL4 forum
  4. Trailing Bar Entry EA - MQL4 forum
Bruno
7
Bruno 2014.07.21 10:45  

Thank you, you solved my problem.

I had it all wrong about how the stoploss worked.

/
To add comments, please log in or register