Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Streamwriter

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

    Streamwriter

    Hi,

    I would like to know if it is normal when using the streamwriter for the text file to show no data until the indicator using the streamwriter function is closed?

    When testing the file attached I found this to be the case.

    Is it possible to do this differently so the data being written to the file is shown in the file as soon as it has been written to the file and you are able to open and close the text file and see the changes?

    Regards,
    suprsnipes
    Attached Files

    #2
    Yes, that's correct suprsnipes - once the write is diposed the buffered resources would be written to the file. You can also look into the Flush method to 'flush' the buffer periodically while the process is still running - http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx

    However since this is more general C#, we could not really offer much support in this area.

    Comment


      #3
      Could I also ask an additional question related to the code sample attached originally.

      With the code under OnMarketData what is the best way to store the last two trades so they are available to measure against one another, i.e difference between the two is an up tick or a down tick.

      How would you do that?

      Comment


        #4
        suprsnipes, you can store reference values in variables in your OnMarketData - if you get a new trade event you know a trade has occurred and you can update those variables then and compare.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X