NexusFi: Find Your Edge


Home Menu

 





Help with HLC


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one RazorSharp with 1 posts (0 thanks)
    2. looks_two Nube with 1 posts (1 thanks)
    3. looks_3 SidewalkAerobics with 1 posts (0 thanks)
    4. looks_4 Shrfu31 with 1 posts (0 thanks)
    1. trending_up 2,017 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
RazorSharp
Dallas TX
 
Posts: 2 since Aug 2018
Thanks Given: 1
Thanks Received: 0

Hi everyone,

I've just started using thinkscript and this is what I have so far.

 
Code
#Define yesterday's "HLC"
def Yhigh = high(period = "day" )[1];
def Ylow = low(period = "day" )[1];
def Yclose = close(period = "day" )[1];

#Plot yesterday's "HLC" 
plot High = (Yhigh);
plot Low = (Ylow);
plot Close = (Yclose);

As you can see, it is very basic and I put it together with the help of existing examples on their help page as I'm still learning. My question is, how do I make the high, low, and close ignore pre- and after-market prices? In other words, I only want the HLCs for the previous day's market hours. I'm sure the answer is staring me in the face, but a little nudge in the right direction would be very much appreciated!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Hormuz Completely Closed: US Strikes Day 2, Iran Shoots …
Traders Hideout
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
April FOMC Minutes: Most Divided Fed Since 1992 -- Many …
Traders Hideout
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
Shrfu31
Philadelphia PA
 
Posts: 1 since Jan 2019
Thanks Given: 1
Thanks Received: 0

Were you ever able to figure out how to only get the Regular Trading Hours plotted?


Reply With Quote
  #3 (permalink)
 SidewalkAerobics 
Los Angels
 
Experience: Intermediate
Platform: MultiChart
Trading: Emini ES
Posts: 115 since Aug 2018
Thanks Given: 173
Thanks Received: 72



RazorSharp View Post
how do I make the high, low, and close ignore pre- and after-market prices?

You can record the high/low/time for X bars back. Then look at the set of bars in the time frame (yesterday) that you want to monitor.


Reply With Quote
  #4 (permalink)
Nube
Minneapolis Minnesota
 
Posts: 24 since Jul 2019
Thanks Given: 0
Thanks Received: 13

This plots the prior day's RTH session high, low and close


 
Code
def rthStart = GetTime() crosses above RegularTradingStart(GetYYYYMMDD());
def RTHEnd = GetTime() crosses above RegularTradingEnd(GetYYYYMMDD());
def RTHStartBar = if RTHStart then BarNumber() else RTHStartBar[1];
def priorRTHStartBar = if RTHStartBar != RTHStartBar[1] then RTHStartBar[1] else priorRTHStartBar[1];
def h = if RTHStart then high else
        if high > h[1] then high else 
        if RTHEnd then h[1] else h[1];
def l = if RTHStart then low else
        if low < l[1] then low else 
        if RTHEnd then l[1] else l[1];
def priorRTHHigh = if RTHEnd then h else priorRTHHigh[1];
def priorRTHLow = if RTHEnd then l else priorRTHLow[1];
def priorRTHClose = if RTHEnd then close[1] else priorRTHClose[1];

plot previousRTHHigh = priorRTHHigh;
     previousRTHHigh.SetDefaultColor(Color.Green);
     previousRTHHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot previousRTHLow = priorRTHLow;
     previousRTHLow.SetDefaultColor(COlor.Red);
     previousRTHLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot previousRTHClose = priorRTHCLose;
     previousRTHClose.SetDefaultColor(Color.White);
     previousRTHClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

declare hide_on_daily;


Reply With Quote
Thanked by:




Last Updated on July 4, 2019


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts