Learning about secondary bar series and using MTF in Ninjatrader
I'm going back to my roots and back to writing code as a means to structure my trading. I've got a technique called "Trade Guides" where I look for all conditions that I want to see and then code them in an indicator that points out what is happening. Like for example (simple .. if only it was this easy):
- Trade Long above the VWAP
- Enter on Moving average cross above
- Exit when the price reaches 3 ATR from the entry
They are nice little guides and I code them as indicators.
When dealing with historical data however they are a bit crude because they effectively function with COBC=True and only take account of the closing price of the bar. My "exit" would only show as an exit if the price closes 3ATR above the entry and not if the price ever reached that level during the bar.
Anyway - I now need to move to the next level. I would like to use a more detailed bar series so that the historical information can be more accurate.
I have a few MTF indicators but can anyone recommend for me a way to get "into" this type of MTF programming.
1. What are the most simple/best commented MTF indies for this usage (i.e. no protected assemblies)
2. Are any of the brooks bars type indicators detailed/MTF in this way ?
This post has been selected as an answer to the original posters question
the examples in NT are a good place to start - they show you how to add a data series
for example the base chart can be the 1 minute chart
you could then add the 5 minute data series and the 15 minute data series
to obtain the high of the current bar you use Highs for the 1 minute, Highs for the 5 minute and Highs - notice the s on the end....
in the onbarclose method you can also have a barsinprogress sections
if (BarsInProgress == 0) // chart base bar
else if (BarsInProgress == 1) //1st added data series
else if (BarsInProgress == 2) // 2nd added data series
I have an indi in the elite download called volprofile. It adds a 1tick data series
NOTE: there are some data series that you can add together, but they muck up the chart/graph. For example mixing time based data series and volume based data series can be done, but the bar charts do not draw correctly. I believe mixing those types in NT 7 requires you to keep track of the bar draws/prints and they get much more complex.
hope that helps....
The following user says Thank You to tulanch for this post: