AVTParticipant
Senior
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.
Put the code on here and some kind soul may be able to help?
Without the code it’s a guessing game?
This is the code you need, I made long time ago for someone in the French forum:
cp = 2
if high[cp] >= highest[2*cp+1](high) then
LH = 1
else
LH=0
endif
if low[cp] <= lowest[2*cp+1](low) then
LL= -1
else
LL=0
endif
if LH=1 then
hil = high[cp]
DRAWTEXT("▼",barindex[cp],hil,Dialog,Bold,12) coloured(100,100,100,100)
endif
if LL = -1 then
LOL=low[cp]
DRAWTEXT("▲",barindex[cp],lol,Dialog,Bold,12) coloured(100,100,100,100)
endif
return
AVTParticipant
Senior
Thanks 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 🙂
Ah sorry AVT, you said in your op … I try to transscript a code from MT4 … so I was suggesting you add the MT4 code on here.
Let us know how you get on?
AVTParticipant
Senior
Fractals 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:
cp = 2
if high[cp] >= highest[2*cp+1](high) then
//if high[cp] >= highest[cp*cp+1](high) then
cp=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?