Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StreamWriter

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

    StreamWriter

    Hello,
    I have used the Streamwriter example and in general all worked fine, only the last bar on the chart ist not updated in the textfile.
    Any suggestions
    Thanks
    Lars

    #2
    Hi Lars,

    This is likely due to your CalculateOnBarClose setting. When set to false, it will process script logic for the bar that's currently forming.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hi Lars,

      This is likely due to your CalculateOnBarClose setting. When set to false, it will process script logic for the bar that's currently forming.

      In my experience, it needs to be false to get the final bar on an EOD chart, too.

      --EV

      Comment


        #4
        Hi Ryan,
        Thanks ! In the Initializie section I have set it to false, but I checked the chart setting and this was on true. After changing it each tick of the bar was appended.
        1) is the a setting where the initialize setting will overrule the chart parameter?
        2) how does only the last acutal value will be written to the file. I assume the last entry must be overwritten each time the a new tick is coming or?
        Thanks
        Lars

        Comment


          #5
          The selection made in the GUI will supersede anything written in the Initialize method. When you write it in the Initialize() method, this determines what is selected in the Gui initially.

          Yes, it will process logic for every tick, so this value is then continuously updated when new prices arrive.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            What can i do to write only the last actual value of the bar ?

            Comment


              #7
              The last actual value can constantly change, so you could store it and only update when it's new.

              Initialize the value somewhere else, maybe during the first tick of bar

              if (FirstTickOfBar)
              myDouble = Close[0];

              if (myDouble != Close[0])
              myDouble = Close[0];

              Write myDouble to file rather than Close[0].
              Ryan M.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              566 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              330 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
              547 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              548 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X