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

Use MergeBackAdjusted and MergeNonBackAdjusted In Same Indicator

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

    Use MergeBackAdjusted and MergeNonBackAdjusted In Same Indicator

    I'm doing an indicator calculation where I need to get the ATR from a backadjusted continuous contract and then I need the price from the non-backadjusted series.

    How would you do this in an indicator?
    • How can I programmatically load a data series with a different merge policy than the global settings?
    • Can you add two data series in an indicator that only differ by merge policy?

    #2
    Hello BarzTrading,

    In general, there is no way to specify the merge policy from code as this is handled at the instrument/platform level. You can add series that specify certain trading hours but not the merge policy as this is controlled by the instrument or platforms global settings.

    If you are using the same instruments, that would be an additional roadblock here as the same data would be used in that situation. In this case, I don't believe this would be inherently possible. I can take a feature request for this item.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks, Jesse. That's helpful. Yes, this capability might only be needed rarely, but there are a few things for which this is VERY useful. I'd also like to see a new merge policy type: "Merge Ratio Back Adjusted". For what I'm doing this would make my life much easier and it would be fairly easy, I think, for your developers to add.

      Finally, I did figure out a roundabout way to have both the backadjusted and unadjusted data series available to the indicator.

      First, you have to load the backadjusted series on the chart using the "ES ##-##" syntax.

      Then in the configure state of your indicator you can look at that primary series, figure out the front contract (or take it as an input parameter), and add the data series "ES 12-18" for example. Meanwhile, your global or instrument merge policy must be set to merge non-back adjusted.

      In this case, the backadjusted series will be available with BarsArray[0] and the unadjusted series will be available with BarsArray[1].

      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