Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries/BarsPeriodType Bars with more that two values?

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

    AddDataSeries/BarsPeriodType Bars with more that two values?

    I have custom bar types that have three values to set, yet BarsPeriodType only supports Value and Value2. How do you add these bar types to a Strategy or Indicator?

    Examples:

    Built-in:
    AddDataSeries(Data.BarsPeriodType.Minute, 1);
    AddDataSeries(Data.BarsPeriodType.Tick, 50);

    Custom with one:
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)149, BarsPeriodTypeName = "149", Value = 4});

    Custom with two:
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)22220, BarsPeriodTypeName = "22220", Value = 8, Value2 = 8});

    Trying the following for custom bar types which take three:
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)1342, BarsPeriodTypeName = "1342", Value = 10, Value2 = 14024, Value3 = 674});
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)20122, BarsPeriodTypeName = "20122", Value = 4, Value2 = 1, Value3 = 7});

    Gives the following:
    'NinjaTrader.Data.BarsPeriod' does not contain a definition for 'Value3'

    Thank you.

    #2
    Originally posted by Darquer View Post
    I have custom bar types that have three values to set, yet BarsPeriodType only supports Value and Value2. How do you add these bar types to a Strategy or Indicator?

    Examples:

    Built-in:
    AddDataSeries(Data.BarsPeriodType.Minute, 1);
    AddDataSeries(Data.BarsPeriodType.Tick, 50);

    Custom with one:
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)149, BarsPeriodTypeName = "149", Value = 4});

    Custom with two:
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)22220, BarsPeriodTypeName = "22220", Value = 8, Value2 = 8});

    Trying the following for custom bar types which take three:
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)1342, BarsPeriodTypeName = "1342", Value = 10, Value2 = 14024, Value3 = 674});
    AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)20122, BarsPeriodTypeName = "20122", Value = 4, Value2 = 1, Value3 = 7});

    Gives the following:
    'NinjaTrader.Data.BarsPeriod' does not contain a definition for 'Value3'

    Thank you.

    They are Value, Value2, and BasePeriodValue.
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      Hello Darquer,

      Welcome to the NinjaTrader forums!

      RJay is correct, the BasePeriodValue can also be used.

      You may want to view the code of the script to see which values are being renamed with the SetPropertyName() method.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thanks, RJay.

        AddDataSeries(new BarsPeriod() {BarsPeriodType = (BarsPeriodType)1342, BarsPeriodTypeName = "1342", Value = 10, Value2 = 674, BaseBarsPeriodValue = 14024});

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        148 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,283 views
        0 likes
        Last Post Leafcutter  
        Working...
        X