Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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!
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #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.

    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
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      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?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        6 responses
        31 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        14 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X