Forum

MT5 Stop Loss on Strategy Test not working as expected

After I write my code and put it to test I observed a strange behavior. The Stop Loss works when running on demo account but when running Strategy Test it does not. The picture below shows the problem. [EDIT] The order was executed. Trailing Stop working and plac ing the S top Loss up and up as long

Doubt - Calculate profits during a month for an EA

I read articles about it here at this forum, one in particular is this one ( https://www.mql5.com/en/forum/154009 ). But so far it is not calculating as expected during Strategy Tester. My goal is to create a method to account the profits accrued during the time the EA is running and check if the

Doubts - Hedging an Order with another

Hi, I am trying to figure out a way to write a MQL4 a kind of Hedging to compensate for an order that wen bad. I will detail. Order 1 - Buy EURUSD at 1.09310 with TP at 1.09331 (21 pips) with LotSize = 0.1. This order backfires and the Virtual Stop Loss, that is not a Stop Loss in my case but a

Help - Fibonnaci indicator that uses ZigZag

Hi, I am trying to create a Fibonacci indicator that once put over a chart it uses the ZigZag to get the 3 consecutives (H,L,H) or (L,H,L) so I can use those values to draw a retracement and extension Levels. Also that once I manually adjust the Fibo Levels it recalculates and updates the buffers. I

Doubts about the behavior of High, Low - Need help

I am trying to implement a function that looks back a number of candles and then finds the local minimum price and the moment in time they happen. I am not sure if I understood correctly the behavior of iLow. So my iteration may be wrong. If I call this min_local( PERIOD_H1 , local_extreme

Code practices to isolate values from instances of my EA - Suggestions?

Hi guys, I am trying to write a EA that can be attached to multiple Charts. My first try on Demo Account showed me that when I attach the EA on two pairs I get the values of my inputs variables shared among the 2 running EA. For example: I have a EA that defines the maximum number of open orders

Calculating Take Profit to get the double of the trade

I am trying to find something similar here in the forum but so far found nothing. My problem is to calculate a Take Profit that allow me to get what I traded so, if I risk US$ 100,00 (converted to the LOT SIZE and taking care of the Margin) on a trade I would like to get the US$ 200,00 in return. I