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.
-
-
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.
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
-
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,
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.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Kaledus, Today, 01:29 PM
|
5 responses
12 views
0 likes
|
Last Post Today, 02:56 PM | ||
Started by Waxavi, Today, 02:00 AM
|
1 response
8 views
0 likes
|
Last Post Today, 02:53 PM | ||
Started by alifarahani, Today, 09:40 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 02:53 PM | ||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 02:41 PM | ||
Started by PhillT, Today, 02:16 PM
|
2 responses
7 views
0 likes
|
Last Post
by PhillT
Today, 02:33 PM
|
Comment