var slowma = null; var fastma = null; function preMain() { setStudyTitle("Price Osc"); setCursorLabelName("Price Osc", 0); setDefaultBarFgColor(Color.red, 0); addBand(0, PS_SOLID, 1, Color.lightgrey); } function main(FastLen, SlowLen) { if(FastLen == null) FastLen = 10; if(SlowLen == null) SlowLen = 20; if(fastma == null) fastma = new MAStudy(FastLen, 0, "Close", MAStudy.SIMPLE); if(slowma == null) slowma = new MAStudy(SlowLen, 0, "Close", MAStudy.SIMPLE); return fastma.getValue(MAStudy.MA) - slowma.getValue(MAStudy.MA); }
Comment