Custom Time Frame Continuity Labels

grapetux

Member
Hey folks. I'm hoping to get some help coding a custom time frame label showing when the current price if above or below the opening price of a 12 hour candle.

I always run my charts with EXT Hours on, showing all the available price date for equities and futures fyi.

This is nod to the STRAT time frame continuity trading concepts. Ideally I would want a single label showing when:

- the current price is trading above or below the midnight open.. (first 12 hour bar : 0000 - 1200)
-the current price is trading above or below the 2nd 12hr hour bar ( 1300 - 2400)

I place trades on lower time frame charts when the 12 hour and 30 min candles are in alignment.

One thing I've noticed, on futures charts.. when you run a 12hr chart with EXT hour on.. it actually pulls the price starting at 1am not actually midnight.

Running an hourly chart with EXT hours on will in fact pull the midnight opening price, not 1am.

Its easy to go in and manually adjust the price by editing the candle itself, but was hoping to have it done automatically if at all possible.

Appreciate any help, enjoy the 3 day weekend

-Cheers
 
Hey folks. I'm hoping to get some help coding a custom time frame label showing when the current price if above or below the opening price of a 12 hour candle.

I always run my charts with EXT Hours on, showing all the available price date for equities and futures fyi.

This is nod to the STRAT time frame continuity trading concepts. Ideally I would want a single label showing when:

- the current price is trading above or below the midnight open.. (first 12 hour bar : 0000 - 1200)
-the current price is trading above or below the 2nd 12hr hour bar ( 1300 - 2400)

I place trades on lower time frame charts when the 12 hour and 30 min candles are in alignment.

One thing I've noticed, on futures charts.. when you run a 12hr chart with EXT hour on.. it actually pulls the price starting at 1am not actually midnight.

Running an hourly chart with EXT hours on will in fact pull the midnight opening price, not 1am.

Its easy to go in and manually adjust the price by editing the candle itself, but was hoping to have it done automatically if at all possible.

Appreciate any help, enjoy the 3 day weekend

-Cheers

This might help. It uses the TOS volumeprofile indicator to define the high/low for the timeframes (12 Hours) input. It plots these on the chart with lines and values, along with optional labels and bubbles.

Screenshot-2023-02-21-091203.png
Code:
#VolumeProfile_2_TradingZones_ProfileHigh_ProfileLow

input zone1begin  = 0000;
input zone1end    = 1300;

def tradingzones  = if SecondsFromTime(zone1begin) >= 0 and SecondsTillTime(zone1end) > 0
                    then 1
                    else 2;
def cond          = tradingzones[1] != tradingzones;

input onExpansion = no;
input profiles    = 4;

profile vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = PricePerRow.TICKSIZE, "value area percent" = 0);
def con = CompoundValue(1, onExpansion, no);

def hProfile = if IsNaN(vol.GetHighest()) and con then hProfile[1] else vol.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) and con then lProfile[1] else vol.GetLowest();
def plotsDomain = IsNaN(close) == onExpansion;

plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));

input showlabels = yes;
def Zone1H = if tradingzones == 1 then ProfileHigh else Zone1H[1];
def Zone1L = if tradingzones == 1 then ProfileLow else Zone1L[1];
AddLabel(showlabels, "0000-1300 | H: " + astext(Zone1H) + " L: " + astext(Zone1L), Color.WHITE);
def Zone2H = if tradingzones == 2 then ProfileHigh else Zone2H[1];
def Zone2L = if tradingzones == 2 then ProfileLow else Zone2L[1];
AddLabel(showlabels, "1300-2400 | H: " + astext(Zone2H) + " L: " + astext(Zone2L), Color.CYAN);

input showbubbles = yes;
addchartBubble(showbubbles and cond != cond[-1], profilehigh, astext(profilehigh), if tradingzones ==1 then color.white else color.cyan);
addchartBubble(showbubbles and cond != cond[-1], profilelow, astext(profilelow), if tradingzones ==1 then color.white else color.cyan, no);
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
501 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top