NexusFi: Find Your Edge


Home Menu

 





Re-direct, duplicate or Read "Output Window" data to File


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Randwulf with 2 posts (0 thanks)
    2. looks_two monpere with 2 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,182 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 Randwulf 
Colorado Springs, CO
 
Experience: Beginner
Platform: NinjaTrader
Posts: 22 since Oct 2009
Thanks Given: 16
Thanks Received: 0

I need to get the data printed to NinjaTraders output window to a file for processing.
It contains data from a couple of stategies at different timeframes.
Re-directing the data to a file would be ideal as, I can copy the window data in realtime now but,
the file gets lengthy for continuous copying and if I could just append a file,
I could delete lines as they are processed.

Any help for a lower/midlevel programmer would be appreciated.
Thx in advance...


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
Friday Update: Markets Now Pricing Fed Rate HIKES as Sta …
Traders Hideout
I Have a Thing Called Iran -- Trump Stays in DC as Airsp …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557


Just use StreamWriter() instead of Print()

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,374

Try:

using System.IO;
.
.
.
File.AppendAllText(filename, textString);


Reply With Quote
Thanked by:
  #5 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 568 since Nov 2011
Thanks Given: 440
Thanks Received: 518

Do you have access to the source code of all strategies or do you want to grab the output text from third party strategies?


Reply With Quote
  #6 (permalink)
 Randwulf 
Colorado Springs, CO
 
Experience: Beginner
Platform: NinjaTrader
Posts: 22 since Oct 2009
Thanks Given: 16
Thanks Received: 0

Thx 4 the replies guys...
Sorry I didn't follow up sooner but, I just checked my email and saw that there were other replies.
I thought Big Mike's response was probably the the end as I had "Thanked" him.

I have written the strategies myself and needed to pull them together.
I was able to accomplish it using StreamWriter, not without much hair pulling however..
It took alot of permutations to figure out what was needed to ensure that the appropriate files
were open or closed at the proper times and that conflicts involving reading & writing at the same time
was averted.
Finally waded through Dispose(), Flush(), Close() ect. to keep resources used at a minimum.
Also, the "try"{ }, "catch"{ } for error handling was helpful.
Anyway, it is working now and I carry on with a thorough testing..
Thx again for the support guys. This is why, this is the best support site bar none...


Started this thread Reply With Quote
  #7 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,374


Randwulf View Post
Thx 4 the replies guys...
Sorry I didn't follow up sooner but, I just checked my email and saw that there were other replies.
I thought Big Mike's response was probably the the end as I had "Thanked" him.

I have written the strategies myself and needed to pull them together.
I was able to accomplish it using StreamWriter, not without much hair pulling however..
It took alot of permutations to figure out what was needed to ensure that the appropriate files
were open or closed at the proper times and that conflicts involving reading & writing at the same time
was averted.
Finally waded through Dispose(), Flush(), Close() ect. to keep resources used at a minimum.
Also, the "try"{ }, "catch"{ } for error handling was helpful.
Anyway, it is working now and I carry on with a thorough testing..
Thx again for the support guys. This is why, this is the best support site bar none...

Did you look at post #4? If you are just logging information, you just need that one line of code.


Reply With Quote




Last Updated on October 2, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts