• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to show time period of chart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to show time period of chart

    Hi there,

    I use the below line of code in an indicator to display a chart's Session Template. Could anyone please tell me what code I could add to this indicator to show the chart's time period. For example "(1 min)" or "(8 Range)"?

    Code:
    ..
    DrawTextFixed("myText", Bars.Session.TemplateName, TextPosition.TopRight);
    Thank-you
    Michelle
    Last edited by michellepace; 05-23-2017, 04:35 AM.

    #2
    Hello michellepace,

    Thanks for your post.

    Here is an example that also includes the instrument full name:

    Code:
    DrawTextFixed("myText", Bars.Session.TemplateName+"\n"+Instrument.FullName+" "+BarsPeriod.Value+" "+BarsPeriod.BasePeriodType, TextPosition.TopRight);
    The "\n" is used to create a new line below the session template name.

    On a CL 07-17 2 minute chart, here is an example of the output:

    Nymex Metals / Energy ETH
    CL 07-17 2 Minute
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul, just what I needed

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gurdonzn, Today, 12:36 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by swcooke, Yesterday, 11:18 AM
      5 responses
      24 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Lisa Marshall, 01-25-2020, 04:11 PM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by utilizator, 01-25-2020, 11:36 AM
      4 responses
      38 views
      0 likes
      Last Post utilizator  
      Started by Aporshnev, Today, 08:46 AM
      2 responses
      19 views
      0 likes
      Last Post Aporshnev  
      Working...
      X