logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ltosamon  
#1 Posted : Friday, June 27, 2014 1:50:06 AM(UTC)
ltosamon

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/15/2014(UTC)
Posts: 1

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.
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.