Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:
    ..
    [COLOR=Red]DrawTextFixed("myText", Bars.Session.TemplateName, TextPosition.TopRight);[/COLOR]
    Thank-you
    Michelle
    Last edited by michelle99; 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 adeelshahzad, Today, 03:54 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      7 responses
      32 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by merzo, 06-25-2023, 02:19 AM
      10 responses
      823 views
      1 like
      Last Post NinjaTrader_ChristopherJ  
      Started by frankthearm, Today, 09:08 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      43 views
      0 likes
      Last Post jeronymite  
      Working...
      X