![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
I'm using 15 minute bars for my strategy and I'm wondering how to make it calculate more frequently than every 15 minutes and less frequently than every tick? (Calculate on bar close)
The obvious downside of per-tick calculation is the CPU power required, and the difference between calculating everytick and every 15 minutes is enormous. Is a compromise possible? I.e. calculate every minute or every x number of ticks? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
You could try a multi-series strategy where the additional series is e.g. 1 minute based.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
How would this apply to "calculate on close" for indicators rather than strategies?
Some can be very CPU intensive as you know. The option to calcuate every other tick or every x ticks could make a dramatic difference in system performance while still giving the benefits of per tick calcuation. Aside from reprogrogramming every indicator, is there currently a way to do this? If not, is this feature in the planning/implenentation stage (i.e. NT7) or in the 'consideration list' stage? |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Not sure I follow. You could have one series 15 mins and another one on a different (smaller?) time frame. No need to go CalculateOnBarClose=false, which basically has nothing to do with this issue.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
I'm using 15 minute bars but I want the indicators on the chart to update (be calculated) more frequently than once every 15 minutes but less frequently than every tick. Changing the time frame would completely change how the indicators are plotted because the parameters are tied to the time interval.
Does that make sense? |
|
|
|
|
|
#6 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Let's make sure we are on the same page:
- your strategy runs on a 15 mins series - you can add another series to this strategy which .e.g. runs 15 secs. You then could use this additional series to trigger your orders http://www.ninjatrader-support.com/H...struments.html
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
For the time being I'm referring simply to the indicators themselves independent of any specific strategy. I read your previous response regarding multi-series strategies which is a valid solution for strategies (albeit slightly cumbersome to code every time) but doesn't seem to be applicable in a non-strategy context. I also realize this is the strategy forum, but didn't want to start a second redundant thread on the same issue.
For example, I'm using the chart trader on 15 minute bars and all indicators are based on a 15 minute time interval. With Calculate on bar close set to true in the indicators parameters it updates once every 15 minutes while the price changes every tick. I would like the refreshing of the indicators to occur more frequently than every 15 minutes. Setting calculate on bar close to false will recalculate every tick which can easily bring a powerful computer to a crawl with multiple instruments and indicators. If I understand correctly, the solution you suggest is to use multiple charts for the same instrument, one with a shorter time frame to have the indicators recalculated more frequently. The problem is that MACD (13,26,9) on a tick based chart will look completely different than MACD (13,26,9) on a 15 minute chart, which is not what I want. Potentially I could use a minute chart and simply multiply the indicator parameters by 15 to approximate the look of the 15 minute indicators, but this solution isn't very eloquent. Updating in tick based intervals in this way also would not be possible because there is no set number of ticks in a time based bar. ![]() Basically, I think it would be very useful to have a parameter to "Calculate every..." as opposed to only the simple Boolean true or false for "Calculate on bar close". Load a chart with multiple intensive indicators on a fast moving market and the reason for this request should be readily apparent. There can easily be hundreds of ticks in a 15 minute bar and only having the option to update the indicators once every 15 minutes or hundreds of times every 15 minutes is inflexible and I believe there should be some middle ground. |
|
|
|
|
|
#8 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
We have multi series indicators on our list for NT7 yet.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#9 | |
|
Senior Member
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 3 times in 3 posts
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Member
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
|
When working with TradeStation, I had a similar issue and solved it by accessing the system clock (ticks), tracking the system tick count, and then immediately returning from the strategy/indicator if the tick count had not progressed far enough. This works well if the overhead is mostly in executing the strategy/indicator logic. Haven't tried this yet with NT.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calculate tick-based indicators on historical bars | JangoFolly | Suggestions And Feedback | 11 | 04-02-2010 11:37 PM |
| Strategy based on BBS indicator | stefy | Strategy Development | 8 | 09-24-2009 05:30 PM |
| Strategy based on indicator value, not price? | cassb | Strategy Analyzer | 2 | 12-19-2007 06:44 AM |
| Need help with strategy based on Simulated stop | vking | ATM Strategies (Discretionary Trading) | 9 | 10-18-2007 06:27 AM |
| Tick-based Performance Reporting | ThePatientOne | Suggestions And Feedback | 1 | 03-27-2007 07:51 AM |