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

Indicator challenge

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

    Indicator challenge

    Elsewhere (http://ninjatrader.com/support/forum...ad.php?t=75726) I have described my need for an enhanced and more flexible approach to indicators so they may be invoked from a strategy using a specifiable DataSeries that has not been Added to the strategy. For example, if I have a strategy with three DataSeries (say ES, CL, TF), using this approach it would be possible to invoke an indicator for values on any other DataSeries that is not one of the three already added in the strategy (e.g. NQ).

    I know this is entirely unsupported in NT7 (although potentially doable in NT8 more easily, though probably still unsupported). However, I have been pointed to the Pivots indicator that uses GetBars to do something very similar, in NT7.

    So, for NT7, in the spirit of adventure and innovation, I decided to merge the Pivots approach with the ATR calculation on the received Bars from GetBars. The outcome is a work-in-progress, but it is certainly a reasonably close (though not yet perfect) analogue of Pivots stripped of the pivots and ATR calculated instead. The ATR values are not yet correct, but the bars returned are correct for the invocations I have been testing (i.e. GetBars returns the right bars on the right instrument at the requested period).

    I suspect the area where my attempt to merge these two indicators is still problematic, and hence not producing correct ATR values compared to "real" ATR on a "real" DataSeries of the type required, is in the merging of the actual ATR calculation. But I am at a loss to spot what is awry. Can't see the forest for the trees at this point.

    So, my request/challenge to any code gurus amongst the NT7 community: I attach the NT7 code as it is -- can you see what is wrong and provide the corrected code? Naturally, I am happy for the working code to be made available to all community members with appropriate attributions for any contributions made. At that point, migrating the working NT7 code to NT8 can also be done and the code made available for that community also.

    Looking forward to hearing from any knowledgeable soul who cares to see what they can do with it.

    Many (many!) thanks in advance to any takers for your efforts!
    Attached Files
    Last edited by jeronymite; 07-01-2015, 10:38 AM.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

Latest Posts

Collapse

Topics Statistics Last Post
Started by yertle, Yesterday, 08:38 AM
7 responses
28 views
0 likes
Last Post yertle
by yertle
 
Started by bmartz, 03-12-2024, 06:12 AM
2 responses
20 views
0 likes
Last Post bmartz
by bmartz
 
Started by funk10101, Today, 12:02 AM
0 responses
4 views
0 likes
Last Post funk10101  
Started by gravdigaz6, Yesterday, 11:40 PM
1 response
8 views
0 likes
Last Post NinjaTrader_Manfred  
Started by MarianApalaghiei, Yesterday, 10:49 PM
3 responses
10 views
0 likes
Last Post NinjaTrader_Manfred  
Working...
X