Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries() Adding Trading Hours Template

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

    AddDataSeries() Adding Trading Hours Template

    I'm adding an additional data series with a trading hours template and receiving error message CS1502 and CS1503. I've also tried adding "null" at the from for the instrument name, but still receiving errors. What is the correct way to do this?

    AddDataSeries(BarsPeriodType.Range, RangeChart, "CME US Index Futures ETH");

    Thanks

    #2
    Hello AgriTrdr,

    That is because there is no overload set for the paramters that you are using. The most simple overload which includes trading hours is the following:

    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)

    The instrument name can be an instruments name or null to assume the chart instrument.
    The bars period would be: new BarsPeriod() { BarsPeriodType = BarsPeriodType.Range, Value = 10 }

    Comment


      #3
      Thank you! This worked. Just for my future reference, should I be using the above even if there's no trading hours template specified instead of:

      AddDataSeries(BarsPeriodType.Range, RangeChart);

      Comment


        #4
        Hello AgriTrdr,

        No if there is no trading hours template to use then you can use one of the other overrides that matches the parameters you wanted. If you want to use trading hours you need to use one of the overload sets that includes it which also requires using BarsPeriod instead of BarsPeriodType.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        93 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        138 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        123 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        73 views
        0 likes
        Last Post PaulMohn  
        Working...
        X