Can anyone help me to convert this code in VT langauge to an EA and custom indicator in MQL4 langauge
Code:
UpCandle:= Close > Open;
DownCandle:= Open > Close;
PrevBarUp:= Ref(C,-1)>Ref(O,-1);
PrevBarDown:= Ref(O,-1)>Ref(C,-1);
PrevBarUp2:= Ref(C,-2)>Ref(O,-2);
PrevBarDown2:= Ref(O,-2)>Ref(C,-2);
PrevBody:= ABS(Ref((O-C),-1));
MarubozuUP:= H=C AND L=O;
MarubozuDown:= H=O AND L=C;
BullEngulf:= O < Ref(Open, -1)
AND O < Ref(Close, -1)
AND C > Ref(Close, -1)
AND C > Ref(Open, -1)
AND Abs(Ref((C+O)/2,-1))<Ref(Mov(C,10,E),-1);
BearEngulf:= O > Ref(Open, -1)
AND O > Ref(Close, -1)
AND C < Ref(Close, -1)
AND C < Ref(Open, -1)
AND Abs(Ref((C+O)/2,-1))>Ref(Mov(C,10,E),-1);
DojiorFly:= O = C;
Hammer1:= H = Open AND (Close - Low >= 2*(Open-Close)) AND Abs(O-C) <= 0.0005;
Hammer2:= H = Close AND (Open - Low >= 2*(Close-Open)) AND Abs(O-C) <= 0.0005;
Gravestone1:= L = Open AND (High-Close >= 2* (Close-Open)) AND Abs(O-C) <= 0.0005;
Gravestone2:= L = Close AND (High-Open >= 2* (Open-Close)) AND Abs(O-C) <= 0.0005;
DarkCloudCover:= DownCandle
AND PrevBarUp
AND O > Ref(C,-1)
AND C < Ref((C+O)/2,-1)
AND C > Ref(O,-1);
PiercingLine:= UpCandle
AND PrevBardown
AND O < Ref(C,-1)
AND C > Ref((C+O)/2,-1)
AND C < Ref(O,-1);
EveningStar:=
DownCandle
{Todays candle is Down}
AND Ref(C,-2)>Ref(O,-2)
{Candle 2 periods ago is an Up candle}
AND (Ref(C,-1)>Ref(C,-2))
{There is a Gap between the middle and one before candle}
AND (Ref(O,-1)>Ref(C,-2))
{There is a Gap between the middle and one before candle}
AND C > Ref(O,-2) AND C < Abs(Ref((O+C)/2,-2))
{Close of todays candle is within the lower half of the candle 2 days ago}
AND Prevbody < Abs(O-C)
{The Previous body of the candle is shorter than the current one}
AND Prevbody < Abs(Ref((O-C),-2));
{The Previous body of the candle is shorter than the one before also}
MorningStar:=
UpCandle
{Todays candle is Down}
AND Ref(O,-2)>Ref(C,-2)
{Candle 2 periods ago is an Down candle}
AND (Ref(C,-1)<Ref(C,-2))
{There is a Gap between middle and one before candle}
AND (Ref(O,-1)<Ref(C,-2))
{There is a Gap between middle and one before candle}
AND C < Ref(O,-2) AND C > Abs(Ref((O+C)/2,-2))
{Close of todays candle is within the Top Half of the candle 2 days ago}
AND Prevbody < Abs(O-C)
{The Previous body of the candle is shorter than the current one}
AND Prevbody < Abs(Ref((O-C),-2));
{The Previous body of the candle is shorter than the one before also}
TweezerTops:= High=Ref(H,-1) AND Ref(H,+1)<H;
{High of current candle = High of previous candle and next candle is going down}
TweezerBottoms:= Low=Ref(L,-1) AND Ref(L,+1)>L;
{Low of current candle = Low of previous candle and next candle is going up}
ConcealingBabyBull:=
MarubozuDown
{Just a body exists - No shadows}
AND Ref(MarubozuDown,-3)
{3rd Candle before was just a body and Down}
AND Ref(MarubozuDown,-2)
{2nd Candle before was just a body and Down}
AND PrevBarDown
{Previous Bar is down}
AND Ref(O,-1)<Ref(C,-2)
{Previous Body Gaps down from the one before}
AND Ref(H,-1)>Ref(C,-2)
{Its shadow rises above the previous bodies Close}
AND Ref(H,-1)<Ref(O,-2)
{But does not exceed the Open}
AND O>Ref(H,-1) AND C<Ref(C,-1);
{Current Candle engulfs the previous one}
KickingBull:=
Ref(MarubozuDown,-1)
{Previous Candle is a Down Body only}
AND MarubozuUP
{Current Candle is Up and is Body only}
AND Ref(O,-1)<O;
{Current Candle Gaps Up from previous Down Candle}