NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-23-2008, 03:16 AM   #1
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default Alternative to tick based/bar based strategy calculation? (i.e every minute/X ticks)

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?
Elliott Wave is offline  
Reply With Quote
Old 05-23-2008, 03:24 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

You could try a multi-series strategy where the additional series is e.g. 1 minute based.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 06-02-2008, 08:45 AM   #3
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

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?
Elliott Wave is offline  
Reply With Quote
Old 06-02-2008, 08:58 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

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.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 06-02-2008, 09:26 AM   #5
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

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?
Elliott Wave is offline  
Reply With Quote
Old 06-02-2008, 09:29 AM   #6
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

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
NinjaTrader_Dierk is offline  
Reply With Quote
Old 06-02-2008, 09:59 AM   #7
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

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.
Elliott Wave is offline  
Reply With Quote
Old 06-02-2008, 10:02 AM   #8
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

We have multi series indicators on our list for NT7 yet.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 06-02-2008, 08:16 PM   #9
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 3 times in 3 posts
Default

Quote:
Originally Posted by Elliott Wave View 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?
You can try this http://www.ninjatrader-support.com/v...ead.php?t=6651
PrTester is offline  
Reply With Quote
Old 07-11-2008, 03:11 AM   #10
greentrader
Member
 
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
Default

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.
greentrader is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 02:02 PM.