MT4 iFractals replacement
Forums › ProRealTime English forum › ProBuilder support › MT4 iFractals replacement
- This topic has 5 replies, 3 voices, and was last updated 7 years ago by AVT.
-
-
07/10/2017 at 9:10 AM #40201
I try to transscript a code from MT4 which is using the iFractals indicator. It’s an MT4 inline indicator and I cannot find any information what this indicator is calculating (just the usage syntax). Any ideas how to get around this?
Thanks very much.
07/10/2017 at 9:26 AM #4020307/10/2017 at 9:27 AM #40204This is the code you need, I made long time ago for someone in the French forum:
12345678910111213141516171819202122232425cp = 2if high[cp] >= highest[2*cp+1](high) thenLH = 1elseLH=0endifif low[cp] <= lowest[2*cp+1](low) thenLL= -1elseLL=0endifif LH=1 thenhil = high[cp]DRAWTEXT("▼",barindex[cp],hil,Dialog,Bold,12) coloured(100,100,100,100)endifif LL = -1 thenLOL=low[cp]DRAWTEXT("▲",barindex[cp],lol,Dialog,Bold,12) coloured(100,100,100,100)endifreturn1 user thanked author for this post.
07/10/2017 at 10:01 AM #40220Thanks for your replies.
@GraHal: Code is relatively simple (compare iFractals value to bars value), so I should get this going on my own. If I don’t try to do it on my own first instead of just asking “please can you code it for me”, I will never learn how to do it.
@Nicolas: going to implement it and see what happens 🙂07/10/2017 at 1:02 PM #4023907/10/2017 at 8:11 PM #40293Fractals part does now exactely what it should do, I limit the painting time. DF (words which you really should not say in public if you are civilized) – took me a whole day to understand it, but I think I got it now.
@Nicolas Just to see that I really got it:code snip123cp = 2if high[cp] >= highest[2*cp+1](high) then//if high[cp] >= highest[cp*cp+1](high) thencp=2 must be a fixed value, because a valid fractal must be less than 4 – we count integers, so we count 3 (less than 4) -> makes us calculate with 3 candles back which is high[2] .
The fractal formula which you use only works because 2*2 is the same as square of 2. If we would break the “valid” rule for a fractal and take iterations beyond 4, we must use the outcommented using the square. Correct?
-
AuthorPosts