NinjaTrader Support Forum  
X

Attention!

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


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

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 09-30-2007, 10:42 PM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default Indicator: Using StreamReader to read from a text file

Sometimes you may have data stored outside of NinjaTrader that you want to bring in and use for calculations. Using StreamReader will allow us to bring in the data stored in text files and allow us to do manipulations with them.

This reference sample demonstrates the following concepts:
  • Opening a text file with StreamReader
  • Parsing Open-High-Low-Close data with date stamps from a file
  • Determining current day Open-High-Low-Close after reading data from the text file with StreamReader
Important methods and properties used include:Other methods and properties of interest include:Import instructions:
  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
Attached Files
File Type: zip SampleStreamReader.zip (2.7 KB, 906 views)
File Type: zip SampleStreamReader_NT7.zip (3.0 KB, 647 views)
Last edited by NinjaTrader_Josh; 09-30-2007 at 10:49 PM.
NinjaTrader_Josh is offline  
Reply With Quote
The following 2 users say thank you to NinjaTrader_Josh for this post:
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
'Hello World' as a text file record ? grd974 General Programming 8 10-25-2012 10:16 AM
Indicator: Using StreamWriter to write to a text file NinjaTrader_Josh Reference Samples 0 09-30-2007 10:38 PM
Need help with Drawing text sisidemo Indicator Development 25 08-30-2007 12:01 PM
Indicator file cached? "Name already in use" error in wizard... funk101 Indicator Development 3 04-27-2007 10:53 AM
NT didn't read the OIF trader25 Automated Trading 7 05-11-2005 02:07 PM


All times are GMT -6. The time now is 07:30 PM.