![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jun 2008
Location: Sydney
Posts: 53
Thanks: 2
Thanked 0 times in 0 posts
|
I have a print command in my strategy that prints CurrentBar as the first command in OnBarUpdate, and I have some other print commands scattered through the strategy to try to solve a problem I'm wrestling with. Yet, when I run a backtest, the first printed string is CurrentBar = 12238. From then on it works fine. As the test is running it appears as though everything is being written to the Output window, as the scroll thumb gets smaller and smaller, but as soon as the test finishes, the thumb goes bigger again.
I also have a print command in front of every enterlong and entershort in the strategy. According to the trade list the backtest has done 89 trades, and I can see them on the chart. However those print commands only produce 8 line in the Output window. I don't get it. How come I only see the last 10% of my print output. Is there a size limit on the Output window or something? Thanks, Ian |
|
|
|
|
|
#2 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,184
Thanks: 178
Thanked 301 times in 259 posts
|
Is the output window filling beyond capacity?
I believe there is a limit before it starts to dump output. It sounds like you are dumping a lot of data? Have you printed time stamps to verify where you are? I don't think the output window holds hours and hours of data...there is no chance of that. ![]() Quote:
|
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 2008
Location: Sydney
Posts: 53
Thanks: 2
Thanked 0 times in 0 posts
|
That was my first thought. But I've dumped a lot of data to the output window before (especially before I discovered the ClearOutputWindow command) and it's never been a problem. Now even a backtest on one day's data causes the problem. It's only 16 trades, and a couple of lines printed for each trade. But I only see four lines of output.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
Are there any errors in the log tab as this happens? Have you tried the same simple test after a clean reboot / restart? There's a output window limit, but you're not near the limits here definitely...
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 2008
Location: Sydney
Posts: 53
Thanks: 2
Thanked 0 times in 0 posts
|
Hi Bertrand,
No nothing like that, but I've solved it. I had ClearOutputWindow at the start of the strategy. I've had this problem before but forgotten about it. If I remove that, everything works fine, but for some reason having that command seems to randomly delete stuff. I've even run the exact same backtest twice in a row and had two different sets of data in the Output window. But once I removed the ClearOutputWindow command it works fine. The only problem now, of course, is that I have to remember to clear the output window before each test! Thanks, Ian |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,184
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
Can you move the command to Initialize? You might have to restart the strategy?? |
|
|
|
|
|
|
#7 |
|
Member
Join Date: Jun 2008
Location: Sydney
Posts: 53
Thanks: 2
Thanked 0 times in 0 posts
|
Thanks Bertrand,
That's correct, output appears to be appended at the end of the existing file (rather than replacing it), and the latest data is shown by default (if you don't use ClearOutputWindow). It's always been in Initialize. And I don't use it when running in real time, only in strategy analyser. Cheers, Ian |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Print doesn't print when CurrentBar ==0 | Lost Trader | General Programming | 3 | 08-13-2010 10:03 AM |
| Need help print past bar time | saroj | General Programming | 2 | 10-11-2009 12:11 PM |
| Print() | duck_CA | Strategy Development | 2 | 03-07-2009 01:18 PM |
| Print the charts with long time series | randomcz | Charting | 1 | 02-24-2009 04:22 AM |
| Synchronization problem in multi-time strats OR multithreading affecting Print()? | qbit9 | Strategy Development | 5 | 10-03-2007 03:02 PM |