Please see the attached screenshot for an example.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
data series issue when translating from NT7 to NT8
Collapse
X
-
Thanks much Jim.
Could you please show me the correct format for implementing this script within Streamwriter ?
Semion.
Comment
-
Hello Semion.AI,
A complete working example that implements a StreamWriter can be found below.
Since StreamWriters are not a NinjaScript specific item, I suggest referencing publicly available C# documentation.
Write characters to a stream with StreamWriter in C#.With StreamWriter, create a new file −StreamWriter sw = new StreamWriter("hello.txt"))Add text to the file −
You may note that in our example, the StreamWriter calls the following lines in OnBarUpdate to open the file, write a line to the file, and to then close the file,
Code:sw = File.AppendText(path); // Open the path for writing sw.WriteLine(Time[0] + "," + Open[0] + "," + High[0] + "," + Low[0] + "," + Close[0]); // Append a new line to the file sw.Close(); // Close the file to allow future calls to access the file again.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
24 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
20 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
14 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
41 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment