Draw line last fractal? MT5
-
Hello everyone. Friends, I am trying to create an MT5 EA that draws a horizontal line at the maximum price of a 4-hour UP fractal and at the minimum price of a 4-hour DOWN fractal. This to take operations in a 15 minute timeframe. So far the only thing I have done is create two variables: fractal_up=0 and fractal_down=0. How can I make the lines I want drawn?
-
This is how I go with the construction of the EA: https://fxdreema.com/shared/SLn8FY58e .I have some problems:
-
When the EA opens a buy operation, it does not place a stop loss (I want to place the stop loss below the last low fractal)
-
In the comments that I place on the graph I see that it shows me the last 15 minute fractals but I want it to show me the last 4 hour fractals.
-
My idea is that based on the last 4-hour high fractal, if the price exceeds it, open a buy operation on the 15-minute chart, which is the timeframe where I operate
thanks for your help
-
-
On point 1 you are using a variable that can have a 0 value. This is why no SL is used. You are requiring to have a fractal on candle ID 3 all the time. If there is one at the moment it is detected, fine, but just one candle later the variable will be 0 again. You need to store the value of the last fractal and just change it when a new one appears, not on every single candle. On point 2, it should work, so I guess the problem is in other parts of the bit we cannot see now. Point 3 will work when point 1 is fixed.
-
@l-andorrà Hi, thanks for your help. In point 2, the EA was not working well. It only showed me the last fractals of the timeframe I was looking at....now with the modifications I made I managed to get the EA to show me the last fractals of H4. Regarding point 1, I understand that I should not place stop loss in the "buy now" block but I am not sure how I should store the value of the last fractal and change it when a new one appears. Should I create two more variables?
-
@kratos this is how I go with the EA: https://fxdreema.com/shared/eaZmdjpne
-
@l-andorrà this is how I go with the EA: https://fxdreema.com/shared/eaZmdjpne
-
@kratos Not necessarily. You can create one only variable that is updated (overwritten) every time a new fractal is confirmed. The previous value will simply be updated by the most recent one.
-
Tambien me interesa saber la respuesta a las preguntas de este post.