Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Output/write to file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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

    Comment


      #3
      SampleStreamWriter -> write to file from a Strategy applied to a list of instruments

      Originally posted by NinjaTrader_ZacharyG View Post
      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.
      Hi ZacharyG,

      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


        #4
        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 tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,281 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Working...
        X