PHP Code:
var vSMA200 = new MAStudy(200, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setPriceStudy(true);
setStudyTitle("200ma-Vol");
setShowCursorLabel(false);
var fp1 = new FunctionParameter("Position", FunctionParameter.NUMBER);
fp1.setLowerLimit(0);
fp1.setUpperLimit(50);
fp1.setDefault(25);
}
function main(Position) {
var vY = formatPriceNumber(vSMA200.getValue(MAStudy.MA));
drawTextRelative(Position, 0, "200ma: "+vY+" Vol: "+volume(), Color.blue, null, Text.RELATIVETOLEFT|Text.BOLD|Text.RELATIVETOBOTTOM, "MS Sans Serif", 10, 1);
return ;
}