Hi,
I'm new to writing EFS code, and I want to plot two lines on an intraday chart.
The first line should be the weekly opening price - (Weekly ATR(100) * 0.65).
The second line should be opening price + (Weekly ATR(100) * 0.65).
Here's my code that doesn't work and I'm not sure what to do next:
Please help. Oh, BTW I'm only expecting the above code to draw one line, but I'd like to do two once I've worked out how to draw one.
Thanks,
Mark.
I'm new to writing EFS code, and I want to plot two lines on an intraday chart.
The first line should be the weekly opening price - (Weekly ATR(100) * 0.65).
The second line should be opening price + (Weekly ATR(100) * 0.65).
Here's my code that doesn't work and I'm not sure what to do next:
Code:
function preMain() { setPriceStudy(true); setStudyTitle("Weekly 65 Percent ATR"); setCursorLabelName("WATR"); setDefaultBarStyle(PS_DASH); setDefaultBarFgColor(Color.red); setDefaultBarThickness(2); setPlotType(PLOTTYPE_FLATLINES); } var bInit = false; var xStudy = null; var nShortATR = null function main() { if(isMonthly() || isWeekly() || isDaily()) return; if(bInit == false){ xStudy = atr(100, inv("W")) * 0.65; xOpen = open(inv("W")); nShortATR = xOpen - xStudy; bInit = true; } return getSeries(nShortATR); }
Thanks,
Mark.
Comment