![]() |
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
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
Does the print statement in the strategy analyer not work when you run a back test.
I am trying the following loop to print the close and date and am not getting anything to the output menu Thanks Tinkerz Code:
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
for (int index = 1; index < 41; index++)
{
if (BarsInProgress == index)
{
if (CurrentBars[index] > 0)
{
Print(Closes[index][0]+"//"+Times[index][0].ToString()+"//index##"+index);
}
}
}
}
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello tinkerz,
To assist you further can you please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email. I look forward to assisting you further. *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
This is still foxing me, I know there is data in the multi indicator script that only goes back to 2011.
If I set the main series back to 2005, I want to print a date when a close does not have value on the 40 added in instruments. But if there is no close for that date whats the exception that will pick it up. I am trying .Nan in a loop The problem is that if there is no data how to I pick it up? Thanks Code:
protected override void OnBarUpdate()
{
for (int index = 1; index < 41; index++)
{
if (double.IsNaN(Closes[index][0]))
{
Print(index+"//"+Times[0][0].ToString());
}
}
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello tinkerz,
If you use the below code can you get the correct print. Code:
for (int index = 1; index < BarsArray.Length; index++)
{
if (CurrentBars[index] < 0) continue;
Print(index+"//"+Times[0][0].ToString());
}
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
Ok 1 more questions thanks
I am trying to run a backtest from 2005, but the prints start from 17/12/2009, is thier a limit on how long a lookback period I can use? |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello tinkerz,
Yes, that would depend on how far your connectivity provider provides data for.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
I am using ES ##-## in position zero, but the trading starts from 2009 even though I am setting the start date in 2005,
Even with the previous code I dont get any dates 2005-2009 in the print statement. But the ES data is there as I can see the chart Why would I not see data before 2009? |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Can you please clarify who you connect to for data? This is displayed in the bottom left hand corner of the NinjaTrader Control Center.
Do you have data for the ES ##-## in Tools--> Historical Data Manager?
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
I use the free daily feed from Kinetic, I do have ES ##-## in the Historical Data Manager, the date range is 01/01/2005 31/12/2012
|
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 1,683
Thanks: 116
Thanked 189 times in 184 posts
|
Hello tinkerz,
Thank you for your response. Please note that the EOD connection provides access to historical daily data only, allowing you to access Daily, Weekly, Monthly and Yearly data for free. The data you see from 01/01/2005, is this Daily data? It is not possible to have data that ends on 31/12/2012 as this would be a future date that data would not exist for at this time. And please advise what interval you are running the strategy on, is it a Daily interval such as Day, Week, Month or Year? I look forward to assisting you further.
Patrick H.
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
Daily data, when I look in edit I see its from 03/01/2005 to 06/08/2012, I picked up the previous dates from export.
Thanks |
|
|
|
|
|
#12 |
|
NinjaTrader Customer Service
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 1,683
Thanks: 116
Thanked 189 times in 184 posts
|
Hello tinkerz,
Thank you for your response. At the top of your Output Window (you will have to scroll up to get to the top of Ouput Window) do you see the following message listed? "You have reached the maximum threshold of the Output window. Some of your output messages have been suppressed" If so, you have reached the limit for the Output Window. If you are running into the limit of the output window, you should consider moving this to a file. You can also consider programatically clearing this with ClearOutputWindow(). Information on ClearOutputWindow() can be found at the following link: http://www.ninjatrader.com/support/h...tputwindow.htm If you wish to move this information to another file, these samples can help with writing information to a file: Using StreamWriter to write to a text file: http://www.ninjatrader.com/support/f...ead.php?t=3475 Using System.IO File properties to write to and read from a text file: http://www.ninjatrader.com/support/f...ead.php?t=3477 Please let me know if you are not receiving the message listed above.
Patrick H.
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
|
No I never had that message, the prints and trades line up, they both start in 2009
|
|
|
|
|
|
#14 |
|
NinjaTrader Customer Service
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 1,683
Thanks: 116
Thanked 189 times in 184 posts
|
Hello Tinkerz,
Thank you for your response. Please send a note to support[at]ninjatrader[dot]com with "ATTN: Patrick" in the subject line and a reference to this thread in the body of the e-mail: http://www.ninjatrader.com/support/f...ad.php?t=51692 I would like to test your Strategy on my end using data from Kinetick EOD Free for the same time period. Please attach your strategy to your response, you will find your strategy on your PC in the (My) Documents\NinjaTrader 7\bin\Custom\Strategy folder. Please also take a screenshot the Backtest parameter window so I may recreate your exact settings on my end. I look forward to assisting you further on this matter.
Patrick H.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Print Statement that allows for seconds | suprsnipes | Indicator Development | 4 | 06-13-2012 09:08 PM |
| Including Label Row In Market Analyzer Print | florida99 | Suggestions And Feedback | 8 | 10-07-2011 01:17 PM |
| How to print strategy analyzer summary page? | ju1234 | Strategy Analyzer | 4 | 02-01-2011 02:51 PM |
| Adding a print statement gives different results. | moldham | Strategy Development | 3 | 04-25-2010 10:43 PM |
| Does using Print() slow down the strategy analyzer? | cunparis | Strategy Development | 2 | 01-07-2009 04:21 AM |