Optuma Forums › Optuma Scripting › Changing the IsUp parameters for rising moving average › Reply To: Changing the IsUp parameters for rising moving average
October 25, 2021 at 3:42 pm
#66363
- Topics: 5
- Replies: 616
- Posts: 621
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…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
//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:
1 2 3 4 5 6 7 8 9 |
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 |
-
This reply was modified 8 months ago by
Matthew.