Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries with instrumentName does not function

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

    AddDataSeries with instrumentName does not function

    Hi
    NT B 11
    I am trying to add to an indicator secondary DataSeries with tradingHours different from those in the chart.

    When I use the command type AddDataSeries(BarsPeriodTypeperiodType,intperiod)
    i.e. same instrument but another period - it works fine .

    However when I try to use the format with another instrumentName
    AddDataSeries(string instrumentName,BarsPeriodbarsPeriod)
    the software does not perform my request
    Attached the code to test it.

    Eventually I want to AddDataSeries with tradingHours different from that on the chart
    AddDataSeries (stringinstrumentName,BarsPeriodbarsPeriod,string tradingHoursName)

    Please test it as well
    Attached Files
    Last edited by doron; 05-13-2016, 10:59 PM.

    #2
    Hello doron,

    Thank you for writing in and for providing your sample script.

    You need to provide the expiry as well for futures instruments.

    In your code, you have:
    Code:
    AddDataSeries("ES" , BarsPeriodType.Second, 30 );
    You will need to add the expiry. For example, for the 06-16:
    Code:
    AddDataSeries("ES 06-16" , BarsPeriodType.Second, 30 );
    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      thx
      now it works .

      I suggest that in the documentation you will elaborate this issue.

      In the documentation you mentioned instrument name

      no hint that expiry date is needed

      any build in method which generates the nearest expiry date in the proper format ?

      how can i set a string variable to contain the instrument name and expiry date of "main instrument in chart " ?

      found it : Instrument.FullName
      Last edited by doron; 05-14-2016, 01:17 PM.

      Comment


        #4
        hi
        in order to add a secondary series to the indicator with the same instrument as the primary one but with the default trading hours of that instrument - use the following command :

        AddDataSeries(Instrument.FullName, new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 1 }, BarsArray[0].Instrument.MasterInstrument.TradingHours.Name.ToS tring());

        The period of the secondary instrument can be assigned as needed


        the attached indicator demonstrate it.

        This indicator is now ready to use primary instrument with trading hours as defined in the chart (e.g. 24*7 ) and in addition the day session trading hours of the same instrument
        Attached Files
        Last edited by doron; 05-14-2016, 11:33 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X