Tony Crabel's Opening Range Formula

#33
please we need help to correct this formula its the tony crable opining range fromula
only the price comes out theres no risistance or support comes out we need help for the correct cood
_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() == 093000, Open);
//Determine the highest high for each day's trading.
//Adjust time as needed for your market.
DlyHigh = HighestSince(TimeNum() == 093000, 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() == 093000, 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();
 
#35
please we need help to correct this formula its the tony crable opining range fromula
only the price comes out theres no risistance or support comes out we need help for the correct cood
_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() == 093000, Open);
//Determine the highest high for each day's trading.
//Adjust time as needed for your market.
DlyHigh = HighestSince(TimeNum() == 093000, 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() == 093000, 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();
try checking the parameters
 
#36
please we need help to correct this formula its the tony crable opining range fromula
only the price comes out theres no risistance or support comes out we need help for the correct cood
...code omitted to conserve space...
Also be sure to check the settings for how your Amibroker records the time of each bar in chart. The default is to use the end time of the bar and it needs to be adjusted so it shows the start time of each bar.
For screen shot of this go to page two of this thread.
Page Two Screen Shot
 
#37
mr-dryheat for the intraday its in start time of interval from the begninng but only the price comes out no ristance no suporrt

i hope rheres some body can help
 
#38
mr-dryheat for the intraday its in start time of interval from the begninng but only the price comes out no ristance no suporrt

i hope rheres some body can help
Check to be sure you are using the most recent version:
Posted here
And also note, as described in the comments of the updated code, only specific time frames are supported. ONLY 3, 5, 7, 10, 15, AND 30 Minute intervals

After you download the updated code and verify you are using one of the supported time frames let me know if you still cannot get the breakout and target levels to display. I will need to know what financial instrument you are charting so I can load it on my PC and see if I can find some other cause.

Dry :)
 
Last edited:
#39
mr-dryheat im very apricciating for your help but i tred this formula before i tred on 5 min.
and 30min. only the averages comes out no support no risstance no breake out im using AmBroker 5.20
 
#40
mr-dryheat im very apricciating for your help but i tred this formula before i tred on 5 min.
and 30min. only the averages comes out no support no risstance no breake out im using AmBroker 5.20
What is the underlying stock/Future/Forex you are charting? Most of my testing has so far only included a small list of items including:
Futures:
ES, NQ, YM, QM, GC
Stocks:
SPY, SSO, QQQQ, QLD, EWC, IYR, IWM, UWM
Forex:
None

Also, if you could click on the bar that represents the opening bar for the market you are trading and give me the date/time stamp for that bar, and do the same for the closing bar, this will help me assist you further.

Dry :)
 

Similar threads