[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stop and reverse code Help needed



PureBytes Links

Trading Reference Links

Hi 

Recently one of the members helped with this indicator - starting and stoping 
of the ploting in response to the market action.

Can anyone suggest changes to generate a signal that can be backtested and 
quantified?

I tried adding buy and sell instead of the plot command, but not the right 
way to do it. 

If anyone can suggest a way I would appreciate it a great deal. (I am trying 
to make a stop and reverse system).

Thanks
Lee

***************************************
Input:
TickSize(.1),
XTics(3),
MA1Len(10),
MA2Len(10);
	
Var:
MA1(0),
MA2(0),
Mode(1);
	

MA1 = Average(L, MA1Len);
	MA2 = Average(H, MA2Len);
	
If Mode = 1 and C < MA1 - XTics * TickSize then Mode = -1;
	If Mode = -1 and C > MA2 + XTics * TickSize then Mode = 1;
	
If Mode = 1 then Plot1(MA1, "MA1");
	If Mode = -1 then Plot2(MA2, "MA2");