extended hrs/pre&post markets - background color

royalrock

Member
Grey background for extended hours is really distracting...is there any way that we can have a different color for pre/post market hours since I want to keep black background for market hours.

I can make full black for both but i dont want to.

Thanks
 
Solution
Grey background for extended hours is really distracting...is there any way that we can have a different color for pre/post market hours since I want to keep black background for market hours.

I can make full black for both but i dont want to.

Thanks

This will allow you to choose the colors you want at the input screen.

Screenshot-2022-12-09-165053.png
Ruby:
#BackgroundColor_Post_Premarket

input postbegin = 1600;
input postend   = 0401;

def sec1    = SecondsFromTime(postbegin);
def sec2    = SecondsFromTime(postend);
def isTime1 = (sec1 >= 0 and sec1[1] < 0) or (sec1 < sec1[1] and sec1 >= 0);
def isTime2 = (sec2 >= 0 and sec2[1] < 0) or (sec2 < sec2[1] and sec2 >= 0);
def inRange = CompoundValue(1, if isTime1 then 1 else if isTime2 then 0 else...
Grey background for extended hours is really distracting...is there any way that we can have a different color for pre/post market hours since I want to keep black background for market hours.

I can make full black for both but i dont want to.

Thanks

This will allow you to choose the colors you want at the input screen.

Screenshot-2022-12-09-165053.png
Ruby:
#BackgroundColor_Post_Premarket

input postbegin = 1600;
input postend   = 0401;

def sec1    = SecondsFromTime(postbegin);
def sec2    = SecondsFromTime(postend);
def isTime1 = (sec1 >= 0 and sec1[1] < 0) or (sec1 < sec1[1] and sec1 >= 0);
def isTime2 = (sec2 >= 0 and sec2[1] < 0) or (sec2 < sec2[1] and sec2 >= 0);
def inRange = CompoundValue(1, if isTime1 then 1 else if isTime2 then 0 else inRange[1], 0);
def postmarket = inRange;

input prebegin = 0400;
input preend   = 0930;
def premarket  = SecondsFromTime(400) >= 0 and SecondsFromTime(0930) < 0;

DefineGlobalColor("PRE", Color.BLUE);
DefineGlobalColor("POST", Color.MAGENTA);
AddCloud(if premarket then Double.POSITIVE_INFINITY else Double.NaN, Double.NEGATIVE_INFINITY, GlobalColor("PRE"), GlobalColor("PRE"));
AddCloud(if postmarket then Double.POSITIVE_INFINITY else Double.NaN, Double.NEGATIVE_INFINITY, GlobalColor("POST"), GlobalColor("POST"));
 
Solution

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

This will allow you to choose the colors you want at the input screen.
Thanks a lot..this is good.

Actually I was looking to have 100% black for market hours(I have now) and then 30% transparency for pre/post markets so that all the indicators would be under one color for proper view.

Looks like that does not seem to be possible , but your script helps to have every other color other than 100% black color for pre/post markets.

Thanks again.
 
Thanks a lot..this is good.

Actually I was looking to have 100% black for market hours(I have now) and then 30% transparency for pre/post markets so that all the indicators would be under one color for proper view.

Looks like that does not seem to be possible , but your script helps to have every other color other than 100% black color for pre/post markets.

Thanks again.

This is closer to your last request. It uses black as the background color which is muted by the default gray in the pre/post market times.

Screenshot-2022-12-11-093123.png

Ruby:
#BackgroundColor_Post_Premarket

input postbegin = 1600;
input postend   = 0401;

def sec1    = SecondsFromTime(postbegin);
def sec2    = SecondsFromTime(postend);
def isTime1 = (sec1 >= 0 and sec1[1] < 0) or (sec1 < sec1[1] and sec1 >= 0);
def isTime2 = (sec2 >= 0 and sec2[1] < 0) or (sec2 < sec2[1] and sec2 >= 0);
def inRange = CompoundValue(1, if isTime1 then 1 else if isTime2 then 0 else inRange[1], 0);
def postmarket = inRange;

input prebegin = 0400;
input preend   = 0930;
def premarket  = SecondsFromTime(400) >= 0 and SecondsFromTime(0930) < 0;

DefineGlobalColor("PRE", Color.black);
DefineGlobalColor("POST", Color.black);
AddCloud(if premarket then Double.POSITIVE_INFINITY else Double.NaN, Double.NEGATIVE_INFINITY, GlobalColor("PRE"), GlobalColor("PRE"));
AddCloud(if postmarket then Double.POSITIVE_INFINITY else Double.NaN, Double.NEGATIVE_INFINITY, GlobalColor("POST"), GlobalColor("POST"));
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
489 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