Index filter script

I’m trying to write a script for an index filter that I can apply to my charts using either a showview or showplot. I want to show where the index -(XJO) is above or below a moving average. Then apply that script to my charts ie BHP. Beyond my skills. Can it be done?

Thanks Peter

 

Hi Peter,

It can be done using the GETDATA() function. You can see an example here:

https://forum.optuma.com/topic/getdata/

In that post the example wraps a ROC() script around the XJO, but it will work for any other function as well including MA() for Moving Averages.

//Source XJO Data
V1 = GETDATA(CODE=XJO:ASX) ;
//Find MA value for XJO
V2 = MA(V1, BARS=150) ;
//Is XJO higher than MA value
V1 > V2

Thanks for the help