Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I use: Bars.Session.TemplateName ?

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

    How can I use: Bars.Session.TemplateName ?

    Hello!
    I want to get the session template name for an indicator. But this code
    Code:
     string templateName = Bars.Session.TemplateName;
    Print(templateName);
    returns the following error message in the output window when applied to a chart, although it compiles without error.

    Failed to get property 'SessionTemplateName' for indicator 'MyIndicator': Object reference not set to an instance of an object.
    How can I get the template session name inside an indicator?

    Best Regards,
    poseidon_sthlm

    #2
    poseidon_sthlm, could unfortunately not reproduce the issue here, works fine on my end. Which contract / session template are you testing with please?

    Comment


      #3
      Thanks for the prompt reply. My misstake. It now works for me too, after remowing and adding the indicator anew. Sorry.

      /poseidon_sthlm

      Comment


        #4
        No worries, glad to hear it.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X