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 3,568 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #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?
Build trailing stop for micro index(s)
Psychology and Money Management
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
GFIs1 1 DAX trade per day journal
22 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
The Program
20 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,399 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,539


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 Twitter 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,371

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: 569 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,371


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts