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 1,415 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Help with HLC

  #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?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
 
  #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: 71



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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts