Highlight Ny Session with rectangle - futures io
futures io futures trading



Highlight Ny Session with rectangle


Discussion in Sierra Chart

Updated
    1. trending_up 643 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Highlight Ny Session with rectangle

(login for full post details)
  #1 (permalink)
Margate, Fl.
 
Experience: Advanced
Platform: SierraCharts
Trading: Futures
 
Posts: 28 since Jun 2009
Thanks: 5 given, 5 received

I would like to highlight the new york session with a highlighted rectangle. I assume that I need to get a bar index from datetime values, not sure how to do that. Please point me in the right direction. Thanks.

 
Code
#include "sierrachart.h" 

 

SCDLLName("MySessionHighlight") 

SCSFExport scsf_MyHighlightSession(SCStudyInterfaceRef sc) 

{ 

   

  // Draw a rectangle highlight 

 

  // Set configuration variables 

  if (sc.SetDefaults) 

  { 

    sc.GraphName = "MySessionHighlight"; 

    sc.GraphRegion = 0; 

    sc.FreeDLL = 0; 

    sc.AutoLoop = 0; //No automatic looping 

 

    return; 

  } 

 

  // Do data processing   

  SCDateTime dtNySessionBegin; 

  SCDateTime dtNySessionEnd; 

  dtNySessionBegin.SetDateTimeYMDHMS(2018, 3, 6, 9, 30, 00); 

  dtNySessionEnd.SetDateTimeYMDHMS(2018, 3, 6, 4, 30, 00); 

 

  int BarIndex; 

 

  int& r_LineNumber = sc.GetPersistentInt(1); 

 

  s_UseTool Tool; 

 

  Tool.ChartNumber = sc.ChartNumber; 

  Tool.DrawingType = DRAWING_RECTANGLEHIGHLIGHT; 

  //int &LineNumber12 = sc.GetPersistentInt(12); 

  if (r_LineNumber != 0) 

    Tool.LineNumber = r_LineNumber; 

  // Update BarIndex to 30 bars from the end 

  BarIndex = max(sc.ArraySize - 25, 0); 

 

       // Tool.BeginDateTime = sc.BaseDateTimeIn[BarIndex]; // <- original 

  Tool.BeginDateTime = sc.BaseDateTimeIn[dtNySessionBegin]; // <- not correct 

 

  BarIndex = max(sc.ArraySize - 15, 0); 

        // Tool.EndDateTime = sc.BaseDateTimeIn[BarIndex]; // <- original 

  Tool.EndDateTime = sc.BaseDateTimeIn[dtNySessionEnd]; // <- not correct 

        

  Tool.BeginValue = sc.GetHighest(sc.Low, BarIndex, 10); 

  Tool.EndValue = sc.GetLowest(sc.Low, BarIndex, 10); 

  Tool.Color = RGB(255, 0, 0);  // Red 

  Tool.LineWidth = 1; //To see the outline this must be 1 or greater. 

  Tool.SecondaryColor = RGB(0, 255, 0); 

  Tool.TransparencyLevel = 50; 

  Tool.AddMethod = UTAM_ADD_OR_ADJUST; 

 

  sc.UseTool(Tool); 

 

  r_LineNumber = Tool.LineNumber;//Remember line number which has been automatically set 

}

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(170 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Market Wizard
Tallinn, Estonia
 
Experience: Beginner
Platform: SC
Trading: NAS100
 
lemons's Avatar
 
Posts: 942 since Nov 2010
Thanks: 1,825 given, 2,258 received


Does it need to be rectangle ?

One option is to use built-in study Time Range Highlight - Transparent


Reply With Quote
 
(login for full post details)
  #4 (permalink)
Margate, Fl.
 
Experience: Advanced
Platform: SierraCharts
Trading: Futures
 
Posts: 28 since Jun 2009
Thanks: 5 given, 5 received


lemons View Post
Does it need to be rectangle ?

One option is to use built-in study Time Range Highlight - Transparent

Thanks for that, but I would like to be able to do the rectangle

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators Sierra Chart > Highlight Ny Session with rectangle


Last Updated on March 7, 2018


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts