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 NullPointStrategies, Today, 05:17 AM
        0 responses
        52 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X