Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

SampleStreamWriter Max Bars Limit?

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

    SampleStreamWriter Max Bars Limit?

    In NT7 I added the SampleStreamWriter indicator to an ^SPX daily chart. But if the "Days to load" parameter is >119, the MyTestFile.txt data stops before the last bar on the chart. Why?

    #2
    Hello ScorpioTravis,

    Thanks for your post.

    That would be because the last daily bar on the chart has not closed and the indicator works with Calculate.OnBarClose = true.

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello ScorpioTravis,

      Thanks for your post.

      That would be because the last daily bar on the chart has not closed and the indicator works with Calculate.OnBarClose = true.
      Thank you for your reply, but it doesn't make any difference.

      Comment


        #4
        Hello ScorpioTravis,

        Thanks for your reply.

        You would need to wait for some time after the day session ends.

        Alternately you could change to Calculate.OnEachTick and you should get today's bar.

        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_PaulH View Post
          Hello ScorpioTravis,

          Thanks for your reply.

          You would need to wait for some time after the day session ends.

          Alternately you could change to Calculate.OnEachTick and you should get today's bar.
          I set Days to load = 200 and End date = 8/19/2021. The text file last line is:

          20210621 4173.4 4226.24 4173.4 4224.79
          20210622 4

          Comment


            #6
            Hello ScorpioTravis,

            Thanks for your reply.

            What data feed are you connected to?

            What specific version of NinjaTrader7 are you using (Look under Help>About, (top line in the about window)).

            Have tried any other instruments, such as ES 09-21?
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_PaulH View Post
              Hello ScorpioTravis,

              Thanks for your reply.

              What data feed are you connected to?

              What specific version of NinjaTrader7 are you using (Look under Help>About, (top line in the about window)).

              Have tried any other instruments, such as ES 09-21?
              Kinetic End Of Day
              7.0.1000.42
              No

              Comment


                #8
                Hello ScorpioTravis,

                Thanks for your post.

                Please post a screenshot of the ^SPX daily chart that you see. Please include the entire chart window so the instrument name, time base, and price scale are visible.


                For a screenshot with Windows 8 or newer I would recommend using the Windows Snipping Tool.

                Click here for instructions

                Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

                Click here for detailed instruction


                Thanks in advance.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  JPG and TXT files attached Click image for larger version

Name:	SPXDaily200.jpg
Views:	135
Size:	112.1 KB
ID:	1168745

                  Comment


                    #10
                    Hello ScorpioTravis,

                    Thanks for your reply.

                    I don't have access to the ^SPX so I could not replicate your efforts. I did test with ES 09-21 and would ask that you try with that instrument.

                    Just to show you the sequence I used, please see: https://Paul-ninjaTrader.tinytake.co...NF8xNzcyODg5Ng

                    Note: In the video, I asked for 125 bars in the data series, which included today's bar but today's bar has not yet closed on the end of day data feed so only 124 were pulled.
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_PaulH View Post
                      Hello ScorpioTravis,

                      Thanks for your reply.

                      I don't have access to the ^SPX so I could not replicate your efforts. I did test with ES 09-21 and would ask that you try with that instrument.
                      I don't understand how you don't have access to ^SPX when it's free to NT users. Regardless, I changed the same chart to ES 09-21, and the same thing happens. Here's the chart and the file.

                      Attached Files

                      Comment


                        #12
                        Hello ScorpioTravis,

                        Thanks for your reply.

                        The text file you present has multiple datas meaning that you are not deleting (or renaming) the file after each use. The data will keep being added on for each run.

                        Please recreate what I am showing in the video, please follow the same steps as I show.

                        1) Remove or delete or verify that the file Documents>Ninjatrader7>MyTestFile.txt does not exist.
                        2) Create the chart with a specific number of bars, by changing days to load to Bars and then entering the value.
                        3) Apply the indicator and set the Calculate on Bar close to "False".
                        4) Wait for a period of time (same time as I waited in the video should be enough) so that the file can be written.
                        5) Remove the indicator from the chart as this will close the text file.
                        6) Open and view the text file.



                        Paul H.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_PaulH View Post
                          Hello ScorpioTravis,

                          Thanks for your reply.

                          The text file you present has multiple datas meaning that you are not deleting (or renaming) the file after each use. The data will keep being added on for each run.

                          Please recreate what I am showing in the video, please follow the same steps as I show.
                          SUCCESS! I followed the steps on both ES 09-21 and ^SPX and it worked as expected.

                          Thank you for your help and patience.

                          However, I noticed in your first reply:

                          That would be because the last daily bar on the chart has not closed and the indicator works with Calculate.OnBarClose = true.

                          But in the instructions:

                          3) Apply the indicator and set the Calculate on Bar close to "False".

                          Thanks again!

                          Comment


                            #14
                            Hello ScorpioTravis,

                            Thanks for your reply, glad to hear of your success.

                            Actually, it should work the same either way (true or false) as you are working with end of day data.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_PaulH View Post
                              Hello ScorpioTravis,
                              Can you provide a link to an explanation for adding an indicator and its values to the output text file? I have a pretty good idea of how to, but I want to be sure.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rhyminkevin, Today, 04:58 PM
                              4 responses
                              52 views
                              0 likes
                              Last Post dp8282
                              by dp8282
                               
                              Started by iceman2018, Today, 05:07 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post iceman2018  
                              Started by lightsun47, Today, 03:51 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post lightsun47  
                              Started by 00nevest, Today, 02:27 PM
                              1 response
                              14 views
                              0 likes
                              Last Post 00nevest  
                              Started by futtrader, 04-21-2024, 01:50 AM
                              4 responses
                              50 views
                              0 likes
                              Last Post futtrader  
                              Working...
                              X