How to create pullback EA?
-
Does anyone know how to create an EA that opens a trade after a pullback? (over EMA, price or whatever)

-
I depends on the conditions you consider a pullback is confirmed. I see you do it based on supports/resistances. If that the only condition it would not be specially hard to do. The question is. Will you need other conditions to confirm that movement is a pullback?
-
@l-andorrà thanks for your answer. Let's suppose I only need to open the trade when price breaks resistance, pullbacks downwards, touches previous resistance and begins to move upwards again
-
Ok. How will your EA define supports or resistances? Will you use a custom indicator?
-
@l-andorrà good point : ) Let's suppose I want to draw the lines myself on the chart
-
In that case you would need some blocks identifying those supports and resistances and then some variables identifying them as one thing or the other. Initially doesn't sound very dificult to implement. Would you include other conditions other than supports and resistances?
-
take an inspiration from this 3 years old thread

https://fxdreema.com/forum/topic/4222/example-price-pullback-ea -
@miro1360 thanks for your answer, but this pullback is based on EMAs which is not what I'm looking for. Besides it's rather complex for a beginner like me, it has several blocks that I don't understand : )
-
@l-andorrà for now, only that. Later, I'll probably mix it with another parameters. How could I begin?
-
Por tu nombre, suena que debes hablar español. ¿Te parece que continuemos el hilo así?
-
@l-andorrà yes I'm from Argentina, but I'd rather continue in English, I've always studied trading in English and I'm not familiar with the spanish terms
-
Ok. The first thing to do is to identify the name of the objects (supports and resistances) you are going to use on the chart. Do you know how to find those names on the MT4 platform?
-
@l-andorrà yes, I know how to name them
-
Ok. How many supports/resistences are you going to include on the chart?
-
To simplify things, only 1
-
Ok. Now how to define a pullback. Let's assume we already have the proce level of that support/resistance. According to your diagram, for a buy to happen price should:
a) Cross down the price level and then moving up?
b) Move close to the price level without touching it and then moving up?
c) A combination of both?
d) Other ?Depending on the answer, the structure will be very different.
-
@l-andorrà option A would be the most preferable. Touch or cross down and then move up
-
How many pips should be down before moving up again? Will you need any oscillator indicator to confirm that change of trend?
-
@l-andorrà I don't know, I guess it depends how far the horizontal line is. The price should go down to touch it, or stop near it. The number of pips doesn't have to be exact.

-
This is exactly what I wanted you to see.
What you want is really easy for a human brain, but an EA requires a detailed chain of conditions to be considered before considering the pullback is ready. You will have to study which scenarios is your EA to work on before trying to add blocks to your project. Can I suggest some questions to be answered beforehand?- How many pips will the peak of the trend above the support line?
- Which minimum/maximum range of pips for point 1 will be considered when considering situation 1 and 2?
- What situation will define a 'contact'? Candles crossinf it with its body? With its wick?
And this is only what I can think of rght now. Can you see it?