Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Writing to a file?
Collapse
X
-
Writing to a file?
Hello, I would like to write the following to a CSV after backtesting: GUID, profit from trade, time in trade, bars in trade. I figured I could just use trace orders for profit, and the other three are easy, however I have no idea how to go about writing to a CSV with ninjascript. Ideally it would create the file to begin, then add every trade throughout the backtest process. Is this something that can be done?Tags: None
-
Hello rbeckmann05,
Thank you for your post.
You can write to a text file using StreamWriter. The formatting of the text file can also make for easy importing into Microsoft Excel in the future.
Below is a sample script that demonstrates using StreamWriter.
Please let us know if you have any further questions.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment