Hi MS Community,
I’m newbie with MetaStock and try to build simple trade system with Expert Advisor.
My code is the following:
{Buy Windows}
SL:= 0.95;
ExtFml("GV.SetVar","Gb" , ValueWhen( 1, Cross( MACD(),0 ), C) );
LE := Cross( MACD(),0 );
LX := Cross( Mov(C ,90 ,E ) , Mov(C ,35 ,E )) OR (C < (ExtFml( "GV.GetVar","Gb" )* SL ) );
Z:= ExtFml("forum.Latch",LE,LX,0,0);
EnterLong:=Z = 1 AND Ref(Z,-1) <> 1;
ExitLong:=Z = 0 AND Ref(Z,-1) = 1;
EnterLong;
{Sell Windows}
SL:= 0.95;
LE := Cross( MACD(),0 ) ;
LX := Cross( Mov(C ,90 ,E ) , Mov(C ,35 ,E )) OR (C < (ExtFml( "GV.GetVar","Gb" ) * SL) );
Z:= ExtFml("forum.Latch",LE,LX,0,0);
EnterLong:=Z = 1 AND Ref(Z,-1) <> 1;
ExitLong:=Z = 0 AND Ref(Z,-1) = 1;
ExitLong;
Sometime, there are the issue that Sell signal shows without matching with sell condition for both cross EMA90 and EMA35 and C < Gb*SL.
Can anyone help to review my code ?
How can I check Gb value for each sell signal point?
Thanks in advance.
Regards,
Tos.