If this not possible, can I write a custom function to write to a file from my strategy?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Output/write to file
Collapse
X
-
Output/write to file
Can I redirect output window to a file so I can debug any strategy issues later?
If this not possible, can I write a custom function to write to a file from my strategy?Tags: None
-
Hello higher.high,
Thank you for your inquiry.
You would be able to use the StreamWriter to write to a text file.
We have a handy reference sample on our support forum that details how this is done: http://ninjatrader.com/support/forum...ead.php?t=3475
To view all the reference samples that we have available, please take a look at this link: http://ninjatrader.com/support/forum...ead.php?t=3220
Please, let us know if we may be of further assistance.Zachary G.NinjaTrader Customer Service
-
SampleStreamWriter -> write to file from a Strategy applied to a list of instruments
Originally posted by NinjaTrader_ZacharyG View PostHello higher.high,
Thank you for your inquiry.
You would be able to use the StreamWriter to write to a text file.
We have a handy reference sample on our support forum that details how this is done: http://ninjatrader.com/support/forum...ead.php?t=3475
To view all the reference samples that we have available, please take a look at this link: http://ninjatrader.com/support/forum...ead.php?t=3220
Please, let us know if we may be of further assistance.
Thanks for the above links - quite useful. I stumbled upon a usecase however: trying to write into a file from a strategy (having similar code to the samplestreamwriter) that's applied to a list of symbols (rather than one symbol alone). And following observations were made:
1) Mutliple threads are started to handle one or more symbols from the instrument list.
2) Keeping the code as is, you'll run into concurency issues around the file handle used to write data into.
So, two questions:
1) Do you have an example where a mutex/semaphore is used such that only one thread at a time can write data into the file-handle?
2) Is there an example of writing data into a (mysql / mssql) database?
Thanks
Comment
-
Hello andrei.reiand,
Thank you for your inquiry.
Unfortunately, we do not have any examples of the two questions that you have asked.
However, it does seem that there is some information about utilizing a database with NinjaTrader here: http://ninjatrader.com/support/forum...ad.php?t=10296
Please, let us know if we may be of further assistance.Zachary G.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by tkaboris, Today, 05:13 PM
|
0 responses
2 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,281 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
2 responses
19 views
0 likes
|
Last Post
by WHICKED
Today, 03:36 PM
|
||
Started by Tim-c, Today, 02:10 PM
|
1 response
10 views
0 likes
|
Last Post Today, 02:52 PM | ||
Started by Taddypole, Today, 02:47 PM
|
0 responses
5 views
0 likes
|
Last Post
by Taddypole
Today, 02:47 PM
|
Comment