• 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

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, 09:38 AM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by YevhenShynkarenko, Today, 08:14 AM
0 responses
1 view
0 likes
Last Post YevhenShynkarenko  
Started by YevhenShynkarenko, Today, 07:14 AM
1 response
6 views
0 likes
Last Post NinjaTrader_Jim  
Started by ttodua, Today, 06:47 AM
0 responses
2 views
0 likes
Last Post ttodua
by ttodua
 
Started by Derjan, Today, 03:09 AM
1 response
9 views
0 likes
Last Post NinjaTrader_PaulH  
Started by usero86, Today, 04:28 AM
5 responses
25 views
0 likes
Last Post NinjaTrader_PatrickG  
Working...
X