Levels Tokyo London New York Markets For ThinkOrSwim

SimpleScript

New member
The idea is to drawing the box around the overnight session, and another box to highlight the Europe or London session, to allow easy visual identification/exchange attribution for any identified support/resistance areas. Want this to work on any Intraday aggregation.

did a bunch of poking around tonite, and what Im thinking might work is to

1) input the start and stop times for the sessions (these below are just examples)

input EUOpen = 0100;
input RTHOpen = 0900;
input RTHClose = 1600;
input AsiaOpen = 1800;

2) use conditional logic to then allow addcloud to paint the boxes to the high and lo of those periods

am I on the right track here?
is there a better way to get RTH/ETH/exchange market hours?
do I need to use secondstilltime? to set the desired range?
what's the best way to capture the max hi and low for that specified time period? use High or HighestAll functions?
TIA
 
Solution
I would like to get someone's input in making TOS upper indicator for ES futures that marks:
1. Previous week high and low (shown as WL, WH)
2. London Range 2am to 5am (for 24 hr only; EST; shown as LRH, LRL)
3. Tokyo Range 8pm to midnight (for 24 hr only; EST; shown as TRH, TRL)
4. New york morning seeion 7am to 10am (for 24 hr only; EST; shown as NYH, NYL)
5. Prior 4 weeks opening gap - friday close and monday open (shown as WOG1, WOG2, WOG3, WOG4)
5. New day opening gap - price difference between 5pm and 6pm (for 24 hr only; EST; shown as DOGH, DOGL)

Thanks

this can be a starting point.
it is set up to pick 1 of 3 preset markets, US, UK, HK . a period of time within a day, that can span over midnight...
Code:
input showOnlyLastPeriod = yes;
def label = yes;

input LOND_Close = 1130;  #NYC Close
def isLONclose = SecondsFromTime(LOND_Close) == 0;
def closePrice = if isLONclose then open else closePrice[1];
plot theClose = closePrice;
theclose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
theclose.SetDefaultColor(Color.DARK_Orange);
theclose.SetLineWeight(2);

def shouldHidePlot = showOnlyLastPeriod and !IsNaN(close(period = AggregationPeriod.DAY)[-1]);
Here are some threads to get you started:
usethinkscript.com/threads/levels-tokyo-london-new-york-markets-for-thinkorswim.14520/
https://usethinkscript.com/threads/ny-london-asian-markets-ict-time-labels-for-thinkorswim.15632/
Thank you. I was able to get this figured out. I was able to use the below code:

Code:
input showOnlyLastPeriod = yes;
def label = yes;

input LOND_Close = 1130;  #NYC Close
def isLONclose = SecondsFromTime(LOND_Close) == 0;
def closePrice = if isLONclose then open else closePrice[1];
plot theClose = closePrice;
theclose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
theclose.SetDefaultColor(Color.DARK_Orange);
theclose.SetLineWeight(2);

def shouldHidePlot = showOnlyLastPeriod and !IsNaN(close(period = AggregationPeriod.DAY)[-1]);
 
Last edited by a moderator:
Hello,

I was trying to search through the threads here but was getting back too many results when trying to see how to correctly code this.

I was hoping someone could please help with the Thinkscript on how to plot a price line for the candle close of the London Stock Exchange (11:30am EST).

Any help is much appreciated! I was trying to pick through some existing price line code I have for other indicators, but couldn't figure out how to code it just for a specific candle close versus a time range.


Below is the code I was trying to tweak, which posts a price level for NYSE opening (9:30am EST).


Code:
input showOnlyLastPeriod = yes;
def label = yes;

def isOpen = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and GetTime() <= RegularTradingEnd(GetYYYYMMDD());

def firstBarOpen = if isOpen and !isOpen[1] then open else if !isOpen then Double.NaN else firstBarOpen[1];

plot OpeningPrice;
OpeningPrice.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
OpeningPrice.SetDefaultColor(Color.BLUE);
OpeningPrice.SetLineWeight(2);

def shouldHidePlot = showOnlyLastPeriod and !IsNaN(close(period = AggregationPeriod.DAY)[-1]);

if shouldHidePlot {
    OpeningPrice = Double.NaN;
} else {
    OpeningPrice = firstBarOpen;
}

##AddLabel(label, "OP: " + AsDollars(OpeningPrice), Color.CYAN);
I thought I had posted this at large but can't find it. It is titled AsGood_EuropeClosingVerticalLine which gives a 10 minute heads up for the closing. It is also part of my AGAIG_BestTradingChartSetup which also has a 10 min heads up for PowerHour (the last hour of trading.

CODE:

#AsGood-EuropeClosingVertical Line
input targetTime830 = 830;
def targetBar830 = SecondsFromTime(targetTime830) == 0;

input targetTime930 = 930;
def targetBar930 = SecondsFromTime(targetTime930) == 0;
AddVerticalLine(targetBar930, "MARKET OPEN", Color.YELLOW);

input targetTime1120 = 1120;
def targetBar1120 = SecondsFromTime(targetTime1120) == 0;
AddVerticalLine(targetBar1120, "UK MARKET CLOSING 10 MIN", Color.WHITE);
 

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
301 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