PureBytes Links
Trading Reference Links
|
Hello All:
The following code will allow you to manually move through you stocks to
check if an buy signal has occurred over the most recent past. It is set
for a period of 20 but this could be shortened to any desirable period.
I wrote this to test to see if the macd() cross on zero was working
right. You can change the buy to any type of signal you want to
investigate. But remember if you put in into another indicator equation
set like the one I put up on the alligator the buy/sell signals below will
replace the earlier ones. So be careful in the context of how you use it.
Steve
/* Guru Commentary */
buy = cross( macd(), 0 );
sell = Cross(0,macd() );
WriteIF(Hold(Buy==1,10),
"Buy signal bars ago " + WriteIF(Hold(Buy==1,10),
WriteVal(BarsSince(Buy==1)),""),
"No Buy Signal") + "\n" +
WriteIF(Hold(Sell==1,10),
"Sell signal bars ago " + WriteIF(Hold(Sell==1,10),
WriteVal(BarsSince(Sell==1)),""),
"No Sell Signal") ;
|