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

Export my data in format Excel

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

    Export my data in format Excel

    hi,..
    i want to do it..
    i want to export my data (i.e. High[0] of daily) in a file....
    i want to read this file in excel

    how i create this script ? thank

    #2
    Hello turbofib,

    Thanks for your post.

    Here is a link to a reference working example of exporting data to a text file that can be read by a spreadsheet program. You can use as is or modify as needed. The code is commented to help clarify its functionality. http://ninjatrader.com/support/forum...ead.php?t=3475
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      i try it...but 've a problem...

      See my pics

      I print candle value but there is character bad
      Attached Files

      Comment


        #4
        Hello turbofib,

        Thanks for your post.

        To debug, add a print statement just above where you are sending the output to the file, have the print statement send the very same data to the output window. Open an output window (Tools>output window) and observe if you see the same characters.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          i have downloaded and imported the samplestreamwriter.
          What do i do next?

          Please help me

          Comment


            #6
            Hello Rawheritage,

            Thanks for your post and welcome to the forums!

            Add the indicator "sample stream writer" to a chart, it will immediate write the data from the chart to a file in Documents>NinjaTrader8> called MyTestFile.txt

            Remove the indicator from the chart when you have collected the needed info.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              There is still character bad?
              javascript obfuscator

              Comment


                #8
                Thanks for the quick reply.

                I checked it and it works, but it does not include data from all indicators i am using. Is it possible to have to include all data from indicators?

                Comment


                  #9
                  Hello Rawheritage,

                  Thanks for your reply.

                  Glad that you have it working.

                  The reference sample is just that a reference example of how to write data from the chart. You can certainly modify the example to output any information you wish. To include indicators data you would need to modify the code to add the indicator output to the output string of data in the reference sample.

                  For example, to include the data of a 20 period SMA, in line 50 you can change it from:

                  sw.WriteLine(Time[0] + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]);

                  to:

                  sw.WriteLine(Time[0] + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]+" "+SMA(20)[0]);

                  Once changed you would need to compile the indicator then remove the indicator from the chart and re-add to the chart to then generate the new data.

                  If you have different charts with different indicators you may have to change this several times or create copies, each matching the charts you wish to draw data from.

                  If you are unfamiliar with Ninjascript/C# programming, we can certainly provide you with links to educations resources to get you started. For you understanding, in the support department at NinjaTrader we do not create, debug, or modify code for our clients.
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks!

                    I am having trouble with one indicator:

                    IndicatorX(color dncolor,int period, color upcolor)

                    I can not figure out how to code the color part.
                    Please help me out. Where can i read about out or maybe you have some examples?

                    thanks!

                    Comment


                      #11
                      Hello Rawheritage,

                      Thanks for your reply.

                      One of the changes that was made in the move from NinjaTrader 7 to NinjaTrader 8 was to replace the implementation of PlotColors for indicators with PlotBrushes - or more specifically, the Drawing.Color structure which was used to set various Color properties has been updated to now use the System.Windows.Media.Brushes class instead.

                      You can find more information on PlotBrushes here:
                      http://ninjatrader.com/support/helpG...lotbrushes.htm

                      You can view any code breaking changes in our help guide here:
                      http://ninjatrader.com/support/helpG...ebreakingtable

                      Please let me know if I may be of any further assistance.
                      Alan S.NinjaTrader Customer Service

                      Comment


                        #12
                        Is there a video tutorial for using Stream Writer to export IEOD data from NinjaTrader? Can it export IEOD data when NT is connected to TD Ameritrade?

                        Comment


                          #13
                          Hello StockJock,

                          We do not have any video tutorials going over this specific item.

                          You will be able to export historical data that is recorded from your TDAmeritrade connection with a StreamWriter.

                          Here is a link to the StreamWriter reference sample:

                          https://ninjatrader.com/support/foru...ead.php?t=3475

                          Please let me know if I may be of any further assistance.
                          Alan S.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by michi08, 10-05-2018, 09:31 AM
                          5 responses
                          741 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by The_Sec, Today, 02:29 PM
                          0 responses
                          1 view
                          0 likes
                          Last Post The_Sec
                          by The_Sec
                           
                          Started by tsantospinto, 04-12-2024, 07:04 PM
                          4 responses
                          62 views
                          0 likes
                          Last Post aligator  
                          Started by sightcareclickhere, Today, 01:55 PM
                          0 responses
                          1 view
                          0 likes
                          Last Post sightcareclickhere  
                          Started by Mindset, 05-06-2023, 09:03 PM
                          9 responses
                          259 views
                          0 likes
                          Last Post ender_wiggum  
                          Working...
                          X