NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 07-24-2009, 02:28 PM   #1
ollywedgwood
Member
 
Join Date: Dec 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default Printing Text to Output Window on the Last Bar of a Chart

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
ollywedgwood is offline  
Reply With Quote
Old 07-24-2009, 02:35 PM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

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
}
If you'd like to view the rest of the thread that I just picked that reply from, click here.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-24-2009, 03:39 PM   #3
ollywedgwood
Member
 
Join Date: Dec 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Austin - that's just the ticket and will enable me to hugely speed up my analysis!
Thanks,
Olly
ollywedgwood is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 04:28 PM.