Forum

Arithmetic anomaly?...

All, Not sure about this one. I learned in school that it doestn' matter what order additions and subtractions are done, the result is always the same. But look at the screenshot. Notice that the result for mrequest.sl is different to sl9. The only difference between the expresseions is the

Ma

All, When I went to school I learned that it doesn't matter what order you do addition and subtraction in, the result is always the same. But observe that in the following code, mrequest.sl and sl9 are both calculated in the same way, but one version (mrequest.sl) has brackets inserted. The results

What does "invalid stops" actually mean?

ike a lot of other people in this forum I am having serious problems understanding what "invalid stops" means (and the infamous 4756 error). Apparently this error is returned when a stop loss or take profit order is too close to the current price , but how close is too close? How is this calculated

Display indicator plots in EA

All, I have two indicators that draw on the chart and display a plot in a separate window. I have an EA that uses the indicators, but when I add the EA to a chart it does not display the plots. It draws the varius lines and arrows on the chart, but no plot. Do I need to specify anything special in

Backtesting long entry price outside candle

All, Apologies if this question is in the wrong area, happy to move it if you want me to. Ran my first backtest today having finally completed my first EA. I ran it in visualisation mode and sat fascinated as I watched it take trades, quite a lot or them winners! Then I noticed something odd. On

How to detect a new bar

Hi All, I'm a complete newbie to MQL5 but I've done a fair bit of coding for other platforms. I'm wondering why it is so difficult for an EA to execute only on a new bar. I've had a look at some of the articles, including the "new bar" event handler, and it seems very difficult. If that won't work