• 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, 05: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 tcfcigvo, Yesterday, 11:39 PM
      0 responses
      4 views
      0 likes
      Last Post tcfcigvo  
      Started by BobbyWan, Yesterday, 09:15 PM
      0 responses
      9 views
      0 likes
      Last Post BobbyWan  
      Started by trader14, Yesterday, 08:23 PM
      0 responses
      2 views
      0 likes
      Last Post trader14  
      Started by ares5918, Yesterday, 02:37 PM
      2 responses
      17 views
      0 likes
      Last Post ares5918  
      Started by RTR1701, 11-15-2016, 11:38 AM
      22 responses
      1,267 views
      0 likes
      Last Post afcmaff
      by afcmaff
       
      Working...
      X