How to use trendlines with EA wizard?
Is it possible to create a condition using EA wizard where ‘IF’ the bid price goes above a trendline which is drawn between two upper fractals, being the last one and the next highest fractal before it?
If so, how would I write this?
It is possible if you write a custom indicator that has data points for the trendline. then, in EA Wizard, you use your if statement saying if price goes above/below this data point (the trendline),then take this action.
But that takes custom coding, which is beyond the scope of EA Wizard.
Thanks for your reply stearno.
I thought of making a simpler condition – If bid price goes above the last upper fractal, then… paint up arrow. This is just a simple component of something more advanced I want to do.
So far I’ve got it right, I’m sure, but there seems to be a bug in the fractals – Using buy & sell signals with the same programming, but getting different signals which look incorrect on BUYS, and correct on SELLS.
I saw someone else in the forum commented on faulty upper fractals when he was trying to use them as stops.
Attached is my file, glad if you took a look and assist, thanks
I thought you wanted to draw a line across the last two fractals and then enter when it crosses that line. You have the correct way if you want to trade when price breaks a fractal.
a possible reason why you are experiencing is that fractals are calculated in the past. Some code calculates a fractal as having Higher High than the previous 3 bars and the 3 following bars. So that would mean a fractal is not even “known” until 4 bars later. So you can only use this fractal to enter on or after the 5th bar.
Other fractal calculations I have seen go up to 5 bars after the fractal happens to define that it is a fractal.
Hope this helps you!
Thanks, it helps a bit. Unfortunately finding the last upper fractal requires custom coding as the shift specifies the last candle not fractal. Is there someone on this forum that would be able to code this for me for a fee? I’d like to select it to find the price value of the last upper & lower fractal. Thanks
Here you go. Free gift. I wrote this for you. It was fun to get back into Mql4. I have not written in that code for maybe a year.
Basically, you choose if you want the fractal to be defined by 3, 5, or 7 bars. Then, it will give an output of the latest Upper and Lower fractals in two buffers, so you can use it in EA’s.
Thanks so much! Is there supposed to be a file attached to your reply? I’d like to test it out. Appreciate your gift very much.
Sorry, guess it did not attach for some reason. Here you go. https://www.dropbox.com/s/s2fdjd16fq5q4u8/Fractal%20Channel.mq4?dl=0 ‘ class=’bbc_url’ title=’External link’ rel=’nofollow external’> https://www.dropbox.com/s/s2fdjd16fq5q4u8/Fractal%20Channel.mq4?dl=0
Sent from my HUAWEI MT7-TL10 using Tapatalk
Got it, thanks!
This is a fantastic indicator and shows me exactly what I’ve been looking for! It shows me the fractal highs & lows – It reminds me of the donchian channels.
I’ve loaded it into my custom indicators in EA wizard – There’s just one thing. I’ve tried to use it in my formula for a signal indicator, firstly to specify a few conditions but it doesn’t seem to be working for me. For example, I have this as an example pseudo code:
The problem with this is there doesn’t seem to be a way to specify ‘IF’ price crosses above the upper fractal channel line, or IF price crosses below the lower fractal channel line. And I’m not sure this code by itself would work properly as a signal indicator either. Any chance you could point me in the right direction?
Yes it does. I realized that it does look similar after I was done and saw it on the chart.
Your strategy does not work most likely because you have to use the shift on the Fractal Channel indicator. For example, if we choose a 5 bar fractal, then the fractal indicator is only drawing 3 bars ago. There is no data on bar 2 and bar 1.
This is because a Fractal is not defined unless it has x bars before and x bars after it that are all below or above the high/low of the middle bar. Only then it defines the fractal. Therefore, your channel is always x bars behind current price.
Another example: if you choose 5 bars to define a fractal, then, you need to use a shift of 3 on the Fractal Channel indicator in the EA Wizard rule to compare against the Close. If you choose 3, then use a shift of 2. If you choose 7, then use a shift of 4. This is the drawback of using a fractal because it is always x bars behind price.
I have attached example to give you a visual to see this explanation.
Thankyou for this advice – I realise what you were saying and still tried to shift 3 the fractal indicator – There’s definitely a glitch in EA Wizard’s fractal indicators, signals work on buys but not sells.
Despite loading your EA, I can’t seem to get it to take any trades. I’ve saved it now as an indicator and it doesn’t show any signals at all, and even when I change IndiShiftForFractalChannel to 5. I’ll maybe have to ask some advice about how to get it signalling trades. This is a very interesting strategy because it’s more purely price action based.
I just tried what stearno uploaded, copied StrategyFractalChannel.mq4 into Experts and Fractal Channel.mq4 into Indicators and MetaTrader visual replay test makes trades
You could check MT Journal for any possible errors
Sorry I am not able to debug the example I made for you. I have too much on my plate right now. But the indicator works and so then the limits your problem solving down to focus on EA Wizard. Good luck and let us know what you find.
Sent from my HUAWEI MT7-TL10 using Tapatalk
Yes, I got the EA taking trades now, thankyou. I notice however, it’s only taking buy trades, and again I think it’s to do with the glitch in EA wizard’s fractals calculations.
Appreciate the input Tomas262