• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access Strategy DataSeries Instruments in Indicator

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

    Access Strategy DataSeries Instruments in Indicator

    I have a strategy that Adds a number of DataSeries in Initialize(). I want to be able to access the Instrument of each DataSeries of that strategy in an indicator. In other words, BarsArray[n].Instrument where BarsArray[n] is one of the added DataSeries.

    No doubt it is unsupported, but would anyone be willing to offer a solution, please?

    Thanks!

    #2
    Hello jeronymite,

    Thank you for your post.

    I created an example that shows how to pass information to an indicator from a strategy.
    You can find this at the following link: http://ninjatrader.com/support/forum...d=5&linkid=666

    Also refer to the Strategy Plot sample as well: http://ninjatrader.com/support/forum...ead.php?t=6651

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Access Strategy DataSeries Instruments in Indicator

      Thanks, Patrick.

      Unfortunately, the code does not address my need. I need to explicitly reference the BarsArray[n].Instrument of any of the DataSeries Added in the strategy . I have been passing values between strategies and indicators using namespace qualification for a long time, but when I try to do this in this case, I get a compiler error "An object reference is required for the nonstatic field, method, or property 'NinjaTrader.Strategy.StrategyBase.BarsArray.get' ".

      A working example of referencing the strategy BarsArray in the indicator would be most helpful. Thanks.

      EDIT (update): I found a workaround (unsupported). I pass the BarsArray instrument name from the strategy to the indicator and in the indicator I invoke NinjaTrader.Data.ExternalAdapter.GetInstrument(<In strumentName>) .
      Last edited by jeronymite; 07-01-2015, 08:24 AM. Reason: Updated information

      Comment


        #4
        Hello jeronymite,

        Thank you for your response.

        You would have to pass the values you need of the Bar Series (High, Low, etc.). Can you give me an example of the script you are using?
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pulpiwapi, 03-04-2019, 11:18 PM
        11 responses
        143 views
        0 likes
        Last Post music_p13  
        Started by indy73, Yesterday, 10:52 PM
        3 responses
        17 views
        0 likes
        Last Post sledge
        by sledge
         
        Started by priceisking, Today, 12:51 PM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by chartish, Today, 10:33 AM
        3 responses
        27 views
        0 likes
        Last Post chartish  
        Started by casabella, Today, 11:51 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X