Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Multi-timeframe/instrument problem
Collapse
X
-
Originally posted by NinjaTrader_Josh View PostMulti-time frame indicators are not supported in NT6.5. They will be in NT7.
Comment
-
kw123, it looks like you're heading in the right direction. What errors did you run into?
To create a multi-instrument strategy you need to add the instrument (we'll use ES 03-10 in this example) in the Initialize() section:
Code:protected override void Initialize() { Add("ES 03-10", PeriodType.Volume, 1000); }
If you'd like, there is also a multi-instrument that comes pre-loaded with a NinjaTrader installation that you could take a look at from Tools -> Edit NinjaScript -> Strategy -> SampleMultiInstrument.AustinNinjaTrader Customer Service
Comment
-
Hi Austin, thanks for your reply.
I've looked at the pre-loaded sample multi-timeframe/multi-instrument strategies, and tried to use them without any success.
For example, if I use 5000 volume chart as my primary timeframe, add another 1000 volume as my secondary timeframe(which will be referred as BarsArray[2],because there a required tick timeframe) and change the following part in the code that refer to the primary to secondary:
From
PHP Code:else if ((base.BarsInProgress == 0) && (base.CurrentBar > this.LastCurrentBar))
PHP Code:else if ((base.BarsInProgress == 2) && (base.CurrentBar > this.LastCurrentBar))
PHP Code:if (base.BarsArray[0].CurrentBar >= Math.Max((this.L1 + this.L2) - 1, this.L3))
PHP Code:if (base.BarsArray[2].CurrentBar >= Math.Max((this.L1 + this.L2) - 1, this.L3))
PHP Code:if (BarsInProgress != 0 )
return;
if(BarsInProgress==0)
{ Print(Time[0]+" "+VolumeSeries[0]); }
PHP Code:if (BarsInProgress != 2 )
return;
if(BarsInProgress==2)
{ Print(Time[0]+" "+VolumeSeries[0]); }
Comment
-
kw123, you are running the strategy on another instrument/period, so it would make sense that the values don't match.
You can try printing more values than just the time and your current data series (price, volume, open, high, low, etc) to help you verify which data set you're working with and such.AustinNinjaTrader Customer Service
Comment
-
This is a wild hunch, but the problem might be caused due to sequencing of the bar update calls. Since your volume charts are multiples of each other, the tick which cause the larger one to trigger will also cause the smaller one to trigger (or round abouts). The sequence in which the ticks for different bars are called might be causing some problem when you are looking for exact data. Try something which is not a multiple (say 1000, and 2500) and see how the results are.
Comment
-
Originally posted by aviat72 View PostThis is a wild hunch, but the problem might be caused due to sequencing of the bar update calls. Since your volume charts are multiples of each other, the tick which cause the larger one to trigger will also cause the smaller one to trigger (or round abouts). The sequence in which the ticks for different bars are called might be causing some problem when you are looking for exact data. Try something which is not a multiple (say 1000, and 2500) and see how the results are.
Hi aviat72, thanks for your advice, I think too it may be something like that, but my programming knowledge is just too limited to figure it out myself.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, Today, 06:11 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:17 AM | ||
Started by algospoke, Yesterday, 06:53 PM
|
1 response
13 views
0 likes
|
Last Post Today, 07:16 AM | ||
Started by FishTrade, Yesterday, 11:11 PM
|
1 response
8 views
0 likes
|
Last Post Today, 07:11 AM | ||
Started by Austiner87, Yesterday, 03:42 PM
|
2 responses
23 views
0 likes
|
Last Post
by Austiner87
Today, 07:03 AM
|
||
Started by mlprice12, 12-21-2021, 04:55 PM
|
4 responses
305 views
0 likes
|
Last Post Today, 07:00 AM |
Comment