Go Back   NinjaTrader Support Forum > NinjaScript Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Thread Tools Display Modes
Old 09-30-2007, 10:38 PM   #1
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,460
Thanks: 1
Thanked 196 times in 85 posts
Default Indicator: Using StreamWriter to write to a text file

Sometimes you may want to store information related to certain market conditions or trades outside of NinjaTrader. The formatting of the text file can also make for easy importing into Microsoft Excel in the future.

Key concepts in this example:
  • Creating a text file with StreamWriter
  • Writing Open-High-Low-Close data with date stamps to the file

Important related documentation:

Import instructions:

NinjaTrader 8
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu Tools > Import > NinjaScript
  3. Select the downloaded file

NinjaTrader 7
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file and click Import.
Attached Files
File Type: zip SampleStreamWriter_NT8.zip (1.7 KB, 32 views)
File Type: zip SampleStreamWriter_NT7.zip (2.3 KB, 78 views)
Last edited by NinjaTrader_Jesse; 05-03-2015 at 08:16 AM.
NinjaTrader_Josh is offline  
Reply With Quote
The following 6 users say thank you to NinjaTrader_Josh for this post:

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
'Hello World' as a text file record ? grd974 General Programming 8 10-25-2012 10:16 AM
Need help with Drawing text sisidemo Indicator Development 25 08-30-2007 12:01 PM
How to write second cross over of MACD? Jenny Strategy Development 2 07-18-2007 06:23 AM
How to write a time period in wizard? Jenny Strategy Development 19 06-18-2007 07:04 AM
Indicator file cached? "Name already in use" error in wizard... funk101 Indicator Development 3 04-27-2007 10:53 AM

All times are GMT -6. The time now is 02:42 PM.

FULL RISK DISCLOSURE: Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.