Hi Optuma
I’m looking to create a scan that finds stocks which have a 50sma which is rising at a specific rate of change. I have tried using the default ‘IsUp’ coding but the stock list produced does not show stocks with a steep enough moving average. I have found forum coding questions in relation to moving average colour change but I want a scan to only find stocks with a steeper sloping moving average. Not sure if it is possible, but if so, could you tell me how to change the default ‘IsUp’ coding so I can use it in scans to generate stocks with whatever degree of moving average slope I specify please?
Hi,
You can wrap a ROC() function around an MA to find the value you are after.
Here’s a quick example using a 40SMA and a 10 Bar ROC…
//Set MA V1 = MA(BARS=40) ; //Find ROC of MA V2 = ROC(V1); //Find where MA ROC is greater than 2 V3 = V2 > 2; //Plot MA ROC and values of 2 or higher Plot1 = V2; Plot1.Plotstyle = Shaded; Plot2 = V3; Plot2.Plotstyle = ShadedStep; Plot2.Colour = Red;
Here is how it would look on a chart using a Show View:
For a scan, you’d look for V3 as the criteria:
pre>//Set MA V1 = MA(BARS=40) ; //Find ROC of MA V2 = ROC(V1); //Find where MA ROC is greater than 2 V3 = V2 > 2; V3