NexusFi: Find Your Edge


Home Menu

 





Custom charting and analyzing questions


Discussion in NinjaTrader

Updated
    1. trending_up 2,798 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Custom charting and analyzing questions

  #1 (permalink)
aks19
Novgorod, Russia
 
Posts: 4 since Jan 2015
Thanks Given: 2
Thanks Received: 0

Hello!

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.

Suppose:
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.

Can I do this with NT?

Thank you.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Are there any eval firms that allow you to sink to your …
Traders Hideout
Better Renko Gaps
The Elite Circle
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
  #2 (permalink)
aks19
Novgorod, Russia
 
Posts: 4 since Jan 2015
Thanks Given: 2
Thanks Received: 0

The first question is not actual now: I have made implemented a chart type by myself.

The second question is still actual.

Reply With Quote
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



aks19 View Post
Hello!

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.

Suppose:
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.

Can I do this with NT?

Thank you.


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.

Reply With Quote
Thanked by:
  #4 (permalink)
aks19
Novgorod, Russia
 
Posts: 4 since Jan 2015
Thanks Given: 2
Thanks Received: 0

Thank you for a reply!


Fat Tails View Post
1. I do not know any instrument that is traded from 10:00-18:45 and from 19:00-23:50.

Moscow Exchange has two trading session for futures and options: intraday(10:00-18:45) and "evening"(19:00-23:50).

Quoting 
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.

At this time I only make backtesting over 2010-2014 years. I downloaded data in 1min bar format with all timestamps in ranges I specified.
Also recently we get back daylight savings schedule


Quoting 
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.

Thats why I use Default 24/7 session template: the break is avoided.

I already tested an entry short position strategy over 2h bars. It gives a little edge(52% of good entries) but I want to improve it in some way. Experement with bars is one of the ways.


Quoting 
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.

Yes, I know about this type of bars but at this time I haven't tick data So is there a custom bar type that can build equivolume bars from 1min bars?

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

Don't use the session template 24/7. Build a session template that uses exchange time. Best enter trading times from 10:00 AM to 23:50 PM.

Quite a few indicators may not work correctly, if you use 24/7.

Also the session template 24/7 is subject to summertime, which is not useful for Russian derivatives.

Reply With Quote
Thanked by:




Last Updated on January 14, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts