Hi afl experts
A friend gave m this afl.
i find it doesnt plot the breakout lines.it plots just price candles.
can somebody fix th problm-make plot breakout lines please!
regards
ford
=============================
A friend gave m this afl.
i find it doesnt plot the breakout lines.it plots just price candles.
can somebody fix th problm-make plot breakout lines please!
regards
ford
=============================
HTML:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("Open Range Break Out");
//Determine the value of the market open. Initial setting is for
//9:30 AM to match US Market Open. Adjust as need for your market
MrktOpen = ValueWhen(TimeNum() == 091500, Open);
//Determine the highest high for each day's trading.
//Adjust time as needed for your market.
DlyHigh = HighestSince(TimeNum() == 091500, High);
//Take a snapshot value of the day's high at the time of market
//close. Intial setting is 4:00 pm to match US Market Close.
//Adjust as needed for your market.
DlyHighest = ValueWhen(TimeNum() == 160000, DlyHigh);
//Do the same for the lowest value of the trading day.
//Adjust time as needed for your market.
DlyLow = LowestSince(TimeNum() == 091500, Low);
DlyLowest = ValueWhen(TimeNum() == 160000, DlyLow);
//Now calculate the min range value using Open, Low and High
//variables calculated above
RngMin = Min(DlyHighest - MrktOpen, MrktOpen - DlyLowest);
//Compres this to a daily time frame in order to capture
//the final value of the Range Min for each trading day
DlyRngMin = TimeFrameCompress(RngMin, inDaily, compressLast);
//Use the compressed variable to calculate a 10 day average
RngMinAvg = MA(DlyRngMin , 10);
//uncompress the daily variable so that it can be used in
//calcuating the long and short break out levels for each day
RngMinAvg = TimeFrameExpand(RngMinAvg, inDaily);
//Use the values calculated above to determine the opening
//range break outs. Notice the Range Min has been shifted so
//that is reads the previous day's value and this is used against
//the current day's open to determine the break out levels
BreakOutLong = MrktOpen + Ref(RngMinAvg, -1);
BreakOutShort = MrktOpen - Ref(RngMinAvg, -1);
//Set parameter default to NO for diplaying values which
//are used to determine core metrics
PlotOHL = ParamToggle("Plot O,H,L", "YES|NO", 1);
//Set parameter default to YES for displaying the final
//results of the break out calculations.
PlotBreak = ParamToggle("Plot Breakout", "YES|NO", 0);
//Plot values per the parameter toggle settings.
if(PlotOHL == 0)
{
Plot(MrktOpen, "Daily Open", colorBlack, styleLine);
Plot(DlyHigh , "Daily High", colorGreen, styleDashed);
Plot(DlyLow , "Daily Low", colorRed, styleDashed);
Plot(DlyHighest , "Daily Highest", colorGreen, styleDots);
Plot(DlyLowest , "Daily Lowest", colorRed, styleDots);
}
if(PlotBreak == 0)
{
Plot(MrktOpen, "Daily Open", colorBlack, styleLine);
Plot(BreakOutLong , "Break Out Long", colorGreen, styleLine);
Plot(BreakOutShort , "Break Out Short", colorRed, styleLine);
}
_SECTION_END();