I am trying to get my first script to run and am failing, output is blank. I want to graph a non-price study that graphs the % price above the 200-day moving average.
Simple script follows.
//{High Jump Description
// This formula returns a plot of the percent prices close above the 200 period moving average
// This formula was generated by Mike Scott
//
//}
var vSMA200 = new MAStudy(200, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setPriceStudy(false);
setStudyTitle("High Jump");
setCursorLabelName("High Jump", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(3, 0);
setPlotType(PLOTTYPE_LINE, 0);
}
function main() {
var vClose = close();
if(vClose == null)
return;
return ((vClose - vSMA200) / vSMA200) * 100;
}
Simple script follows.
//{High Jump Description
// This formula returns a plot of the percent prices close above the 200 period moving average
// This formula was generated by Mike Scott
//
//}
var vSMA200 = new MAStudy(200, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setPriceStudy(false);
setStudyTitle("High Jump");
setCursorLabelName("High Jump", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(3, 0);
setPlotType(PLOTTYPE_LINE, 0);
}
function main() {
var vClose = close();
if(vClose == null)
return;
return ((vClose - vSMA200) / vSMA200) * 100;
}
Comment