NinjaTrader_Josh
09-30-2007, 11:48 PM
Using Stream objects can be cumbersome when you only want to write/read a small amount of data. Fortunately, you can handle this operation with another method. Keep in mind that in exchange for the convenience you will lose some performance.
This reference sample demonstrates the following concepts:
Creating and appending a text file with Open-High-Low-Close data and date stamps
Determining current day Open-High-Low-Close after reading data from the text file Important methods and properties used include:
File.AppendAllText() (http://msdn2.microsoft.com/en-us/library/system.io.file.appendalltext.aspx)
File.ReadAllText() (http://msdn2.microsoft.com/en-us/library/system.io.file.readalltext.aspx)Other methods and properties of interest include:
File.ReadAllLines() (http://msdn2.microsoft.com/en-us/library/system.io.file.readalllines.aspx)
File.WriteAllLines() (http://msdn2.microsoft.com/en-us/library/system.io.file.writealllines.aspx)Import instructions:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file
This reference sample demonstrates the following concepts:
Creating and appending a text file with Open-High-Low-Close data and date stamps
Determining current day Open-High-Low-Close after reading data from the text file Important methods and properties used include:
File.AppendAllText() (http://msdn2.microsoft.com/en-us/library/system.io.file.appendalltext.aspx)
File.ReadAllText() (http://msdn2.microsoft.com/en-us/library/system.io.file.readalltext.aspx)Other methods and properties of interest include:
File.ReadAllLines() (http://msdn2.microsoft.com/en-us/library/system.io.file.readalllines.aspx)
File.WriteAllLines() (http://msdn2.microsoft.com/en-us/library/system.io.file.writealllines.aspx)Import instructions:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file