I'm trying to write a simple trend following strategy in ninjascript 8. Basically, sma 50 is up and stochs cross from below 15, then buy. However, I only wish to buy on the 1st and 2nd pull backs. How can i set my script to ignore all other pull backs. I'm looking for something that can evaluate the number of pull backs that have occurred since the the price crossed the SMA from below.
Can anyone point me in the right direction?
Thank You
Comment