Is there something special I need to do in the code?, a flag?, or a setting somewhere?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to Enable Strategy Analyser on Strategy
Collapse
X
-
How to Enable Strategy Analyser on Strategy
I have developed a strategy which work on both the NT 'Replay' and Simulator, but doesn't seem to executve any trades not output anything to the 'Output Window'... which basically means it's not running.
Is there something special I need to do in the code?, a flag?, or a setting somewhere?Tags: None
-
Hello,
Thank you for your note.
Can you please clarify are you trying to run this straregy live or in the strategy analyzer?
In this strategy are you using any if(Historical) checks or ATMStrategies as this would not allow the strategy to run in the Strategy Analyzer.
Also, please insure you have data for the instrument you are trying to test.
I look forward to assisting you further.BrettNinjaTrader Product Management
-
-
Hello,
The strategy analyzer is only for running on historical data.
Also, The reply data is not historical data, you must be connected to eSignal for historical data.
Also, to calculate on each tick in the strategy analyzer since the strategy analyzer only runs on the OHLC of the chart its run on not tick by tick. To get it to run in this mode you have to add instrabar granularity.
You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
Also, how a strategy backtest can be different:
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
-
So I added:
"Add(PeriodType.Tick, 1);"
Which per my understand would add a one tic data series then
potected override void OnBarUpdate(){
if (BarsInProgress == 1)
{
//code there base on
double point = Bars.LastPrice;
}
}
It seems that OnBarUpdate is not getting called every tick and only at the end of the backtest... Am I correct?
So for my to monitor the ticks based in OnBarUpdate() in Strategy Analyser is not possbile?
I have this working perfectly in Simulation and Market Replay...
Sorry, but I am missing something?
You help is greatly apreciated!
Comment
-
Hello,
No this should not be the case it would be added it.
Please verify you have tick data however. Most likely you dont hve the tick data you need. If I remember correctly eSignal only supports 10 days of tick data.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
-
I ran on last 10 days and it seems that the tick data does exist, but the onbarupdate() doesn't get fired for each tick? It seems that is on gets called on the last day on the close?
The chart in strategy analyst shows the tick data!
Do I need to code the this? Meaning should I not be using Bars.LastPrice and instead lopping through ALL the bar data each time OnBarUpdate gets fired on the last day? To me it seems on the close of the last day it gets fired for each tick... So Bars.LastPrice value is always be the close of the last day when onbarupdate() is called.
Thanks for your help!!
ChrisLast edited by cjwallac; 01-17-2011, 08:25 AM.
Comment
-
Hello,
This should work, at this point in time. I'm going to need to look into your strategy to see what is possibly off.
Please send this to support at ninjatrader dot com. Reference this forum thread and put ATTN: Brett in the subject line.
I look forward to assisting you further.BrettNinjaTrader Product Management
Comment
-
Hello,
The issue I see here is that you added everything in the BarInProgress == 1 check. This will only allow all your code to run on the Secondary data series which would be the tick series.
Which is not want you want considering that your strategy does not process any trades while running on a tick chart.
You want to have everything run on the original time frame you build the strategy on. This would be your BarsInProgress == 0 is what you want to use here.
Then instead of EnterLong() in the BarsInProgress == 0 which will only be on the OHLC of the input data series. You would instead set a flag to go long.
Then add another seperate section of code for your if(BarsInProgress == 1) check.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
25 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
120 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|
Comment