I am relatively new with NinjaTrader.
I have made some searches but couldn't find answers to the following questions.
The first one is about joining 1min bars into bars of bigger size using custom rules.
1. I have historical data in 1min bar format.
2. There are two trading sessions during calendar day: from 10:00-18:45 and from 19:00-23:50.
There are reasons to group 1min bars of each calendar day for backtesting in the following way:
1. First bar: 1 min bars from 10:00-12:00(2h)
2. Second bar: 1 min bars from 12:00-14:00(2h)
3. Third bar: 1 min bars from 14:00-16:00(2h)
4. Fourth bar: 1 min bars from 16:00-18:00(2h)
5. Fifth bar: 1 min bars from 18:00-18:45 and from 19:00-23:50(0:45 + 4:50 = 5:35)
I.e. there are 1min bars representing trading sessions during the same calendar day and I want to group them using some custom rules, make charting and run backtesting over such dataseries.
How can I do it with NT?
The second one also is about joining 1min bars.
But now I want to join using volume, i.e. to form data series for charting and backtesting using volume in the following way: each new bar appears after some trading volume is happened.
For example, let's each bar appear after 50k of security is traded:
1. Market open, volume 0, first bar with current price is showed.
2. In the first 2 min trading volume is 49999 -> just update the first bar
3. During the third min trading volume is 2 -> finish the first bar and open the sond one with trading volume 1.
1. I do not know any instrument that is traded from 10:00-18:45 and from 19:00-23:50. With any software, you cannot use your local time to specify trading times, but you have to use exchange time. For example. if you live in Russia your local time will not have the daylight savings schedule to switch to summertime and your trading times will be off, and you have to readjust them twice per year. This makes backtesting impossible.
Therefore, you need to specify trading times by using the time zone of the exchange and then you need to use a session template which specifies that time zone and the contractual trading times for the instrument.
Also it does not make sense to use 120 min bars (2 hours) as you suggest. A price bar that is divided between the two sessions should be avoided. If you enter a session template with the two sessions then NinjaTrader will introduce session breaks at 18:45 and 23:50 (covnerted, both set in exchange time). The session break will truncate any price bar and close it.
For example a session from 10:00 to 18:45 would have five 120-min bars. The first 4 bars would have a duration of 120 min each, the last bar would have a duration of 45 min. This does not make sense. If you use hourly bars
-> the first session would have 8 complete 60 min bars and a 45 min bar
-> the second session would have 4 complete 60 min bars and a 50 min bars
This looks okay to me, as the two last bars each have a duration that comes closer to a full hour.
2. NinjaTrader allows you to display volume bars (also called equivolume bars). When you open your chart select "Type" = "Volume" under DataSeries settings. Volume bars are built from tick data. Therefore you need a data supplier who offers historical and real time tick data.
The following user says Thank You to Fat Tails for this post: