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 07-01-2008, 06:06 PM   #1
mikeyork
Junior Member
 
Join Date: Jul 2008
Posts: 24
Thanks: 0
Thanked 0 times in 0 posts
Default Designing multi-instrument, multi-timeframe

I would like some advice regarding a design approach for a complex strategy. (I'm ok with programming, I don't anticipate running into problems I can't handel -- famous last words.)

Q1. Is it necessary to open a chart to run a strategy?

Q2. The strategy I am planning involves an single indicator/oscillator derived from from three instruments and trading three other instruments together as a basket. Each of the first three instruments needs two timeframes. There is no obvious bar series (either from the indicator or the basket) that stands out as a preferred default. Do I just pick any one instrument as a default, open a chart and specify one of the time frames? What are the possible/likely unanticipated consequences of this undesired asymmetry between instruments?

Q3. Do I have to open a separate chart for every instrument I wish to trade? If so, does each chart have to recalculate the oscillator separately? How do I keep the basket in synch?

Q4. Is it possible to put the complete traded basket on a single chart, together with the oscillator from the non-traded instruments?
mikeyork is offline  
Reply With Quote
Old 07-01-2008, 11:05 PM   #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

1) No, see "strategies" tab and related docs
2) Multi series indicators are not supported at this time. Strategies are though. Does not matter which series is the first
3) see (1)
4) No, see (1)
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-07-2008, 03:55 PM   #3
mikeyork
Junior Member
 
Join Date: Jul 2008
Posts: 24
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
1) No, see "strategies" tab and related docs
2) Multi series indicators are not supported at this time. Strategies are though. Does not matter which series is the first
Thanks. I see.

So this raises a question. In my strategy code, how do I know which of the 6 currency pairs I have chosen (from the strategy dialog) as the default first series? Alternatively, how can I make the data series specified in the strategy dialog always be a default choice that the strategy code knows and the user can't change?

I'm guessing that the answer to both questions is that I can't. And I can live with that answer (uncomfortably). But this irks me as I don't like to sacrifice generality, particularly when it requires me remembering unimportant stuff that I have put into the code (like which indicator pair I must always use for the first series).
Last edited by mikeyork; 07-07-2008 at 04:00 PM.
mikeyork is offline  
Reply With Quote
Old 07-07-2008, 06:22 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

1) You don't, you need to just pick one pair to always run on the chart.
2) Unfortunately this is not supported.
3) I see your point and will consider if we could support this in the future.
NinjaTrader_Ray is offline  
Reply With Quote
Old 07-08-2008, 07:18 PM   #5
mikeyork
Junior Member
 
Join Date: Jul 2008
Posts: 24
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks again.

Now I have some different questions concerning the order of event handling.

1. I have three instruments each with two Added bar series. The first is a multi-minute bar and the second is an indicator built on the first, but with an OnBarUpdate method called per tick. The OnBarUpdate method for the complete strategy also functions per tick. For any given instrument, which OnBarUpdate method gets called first? (In other words, how do I know if the indicator has already been updated when the strategy method is called?)

2. If a tick coincides with a bar close, which event triggers OnBarUpdate first, the bar close or the tick?

3. Are my questions materially irrelevant?
mikeyork is offline  
Reply With Quote
Old 07-08-2008, 08:47 PM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Indicators will always be current as your strategy calls them. A tick is the source for determining when a bar is closed. Your questions are irrelevant.
NinjaTrader_Ray 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
Multi TimeFrame Setting Edgar V. Strategy Development 11 03-19-2008 10:02 PM
Volume for Multi-Timeframe GuyFB General Programming 8 02-01-2008 03:01 PM
Multi Time Frame/Multi Instrument? GreenTrade Strategy Development 3 01-14-2008 02:24 PM
Multi Timeframe error Learning1 Strategy Development 2 09-14-2007 07:53 AM
Multi-Timeframe use in a Strategy Freddie Strategy Analyzer 25 05-30-2007 07:02 AM


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