![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Dec 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
Hi folks,
Wonder if anyone could help - I would like to print a single calculation result to the output window when a strategy has finished backtesting an instrument. In other words, is it possible to get NT to recognise the last bar of a loaded chart series so a single calculate-and-print action can then be run in a strategy? The idea is to be able to run a basket of instruments in a backtest, resulting in an output window with a performance calculation result for each instrument. Many thanks for any suggestions! Olly |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Olly, unfortunately there isn't a method to check if the backtest has completed.
You can include code that writes to a file in OnBarUpdate throughout your backtest without a problem. If you know the timestamp (and date) of the last bar you're testing, you can also just try hardcoding that value into your strategy. Maybe something like in OnBarUpdate: Code:
if(ToDay(Time[0]) == DayOfLastBar && ToTime(Time[0]) == TimeOfLastBar)
{
//insert code here that you'd like executed at the end of backtest
}
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Dec 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Austin - that's just the ticket and will enable me to hugely speed up my analysis!
Thanks, Olly |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to export Output Window programmatically to a text file? | ninjaq | Strategy Development | 12 | 03-25-2009 03:30 PM |
| Colored text in output window? | heech | Strategy Development | 1 | 03-03-2009 10:02 AM |
| Output window text | kenzo | Strategy Analyzer | 3 | 12-12-2008 10:30 AM |
| why is this not printing to the output window | junkone | General Programming | 8 | 11-26-2008 07:35 AM |
| Printing the Output Window | RVRoman | General Programming | 3 | 08-07-2008 10:57 PM |