Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
MTF NT7 backtest
Collapse
X
-
MTF NT7 backtest
Hi, if I use the code "Add(PeriodType.Minute, 60) and then reference it with a BarsArray[1] etc the same way I do in NT6.5, in the backtest it enters the first trade and stays in no matter what till the end of the test period. Is there a change in the way this needs to be coded?
ThanksTags: None
-
Exit condition is profit target or stop loss, which works fine before I add the second timeframe.
I haven't been using "BarsInProgress", as I haven't been using it in NT6.5.
eg; Add(PeriodType.Minute, 60); in the initialize
and SMA(BarsArray[1], 50)[0] > SMA(BarsArray[1], 50)[1] in condition set works in NT6.5 but not in 7.
I tried to add "TraceOrders = Trua;" and then "TraceOrders == True;" in the initialize section of the code but I get the "The name True does not exist" error on both attempts.
Thanks
Comment
-
OK, I added the "if (BarsInProgress ==0) line but N7 still takes the first trade and stays in till the end of test period ignoring the Profit target and Stop loss. On my second machine with N6.5 I have the same code and it performs as expected.
I would still like to know how to get the "trace orders" to work.
Thanks
Comment
-
I use the same PT and SL as with the backtest without the addition of the second time frame.
I just ran a test where I removed the "Add(Per", "BarsInPro" ,"BarsArray" lines from the code an ran a backtest without touching the PT and SL and it performed as expected.
I then add the "Add(PeriodType.Minute, 60);" line without the other two lines and it did the "take the first enty and stay in till end of test period".
Comment
-
In this case for me to further assist I would need to take a look at your code. There is something that is missing in regards to running a multi-series strategy since it does work when you add the Multiseries.
Can you please send your strategy to support at ninjatrader dot com and reference this forum post and put attn Brett in the subject line and I will take a quick look to see whats causing this.BrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
605 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
351 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment