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

Draw old executions from a csv file on chart?

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

    Draw old executions from a csv file on chart?

    Hi everyone,

    Is there a sample code that can draw old executions from a csv file on chart? The csv file contains symbols, execution time, execution price, execution quantity...

    Thanks,
    Tom

    #2
    Hello istock999,

    Thank you for your note.

    Yes this is possible. I put together a sample which will read dates contained in a file called MarkTheseDatesOnChart.txt.

    Import the indicator and apply it to a chart. Remove the indicator. Drop the file MarkTheseDatesOnChart.txt (attached) into My Docs>NT8>APData>Inputs folder which would have been created when you first applied the indicator.

    Apply the indicator to a daily chart and you will see arrows drawn on the bars matching the dates in the file.

    You will need to modify your saved dates to fit the format in the text file, or change the logic in the indicator to point and parse your csv file.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AlanP View Post
      Hello istock999,

      Thank you for your note.

      Yes this is possible. I put together a sample which will read dates contained in a file called MarkTheseDatesOnChart.txt.

      Import the indicator and apply it to a chart. Remove the indicator. Drop the file MarkTheseDatesOnChart.txt (attached) into My Docs>NT8>APData>Inputs folder which would have been created when you first applied the indicator.

      Apply the indicator to a daily chart and you will see arrows drawn on the bars matching the dates in the file.

      You will need to modify your saved dates to fit the format in the text file, or change the logic in the indicator to point and parse your csv file.

      Please let us know if you need further assistance.
      Hi Alan,

      Thank you very much for the help. I am a brand new user of NT, could you tell me how to apply the indicator in the zip file? Or just send me the link of the instruction for apply the indicator.

      Best,

      Tom

      Comment


        #4
        Hello istock999,

        To Import a NinjaScript into NinjaTrader 8 do the following:From the Control Center window select Tools -> Import-> NinjaScript...
        Find the file location.

        After you've imported the indicator you should be able to right click on the chart>indicators select the indicator MarkDatesFromFileOnChart.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Never mind, I re-installed NT and was able to load the indicator successfully.

          Comment


            #6
            Originally posted by NinjaTrader_AlanP View Post
            Hello istock999,

            Thank you for your note.

            Yes this is possible. I put together a sample which will read dates contained in a file called MarkTheseDatesOnChart.txt.

            Import the indicator and apply it to a chart. Remove the indicator. Drop the file MarkTheseDatesOnChart.txt (attached) into My Docs>NT8>APData>Inputs folder which would have been created when you first applied the indicator.

            Apply the indicator to a daily chart and you will see arrows drawn on the bars matching the dates in the file.

            You will need to modify your saved dates to fit the format in the text file, or change the logic in the indicator to point and parse your csv file.

            Please let us know if you need further assistance.
            Hi Alan,

            I added more dates into MarkTheseDatesOnChart.txt, but they didn't get reflected on charts. Is there a way we can see the updates in MarkTheseDatesOnChart.txt on the fly?

            Thanks,
            Tom

            Comment


              #7
              Hello Tom,

              You should be sure to save the text file after adding them, then refresh the indicator by pressing F5 on the keyboard.

              To see the values as you update them in the text file would still require a refresh of NinjaScript, so I'm not aware of a way of a way around that.

              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                Thanks Alan. The code works well now.

                One more question, assume I have 2 panels on a chart, and both panels have the same data series and same time frame, I want to know how to draw text on panel 2, not panel 1 by default?

                BTW, how to close a panel quickly?
                Last edited by istock999; 09-26-2018, 10:21 PM.

                Comment


                  #9
                  Hello istock999,

                  Attached is an indicator which will plot arrows on the input series and panel its applied to.

                  You could see the attached screen shot of how I set it up to draw on the 2nd panel.

                  The quickest way to minimize a panel would be to click the top boarder of the panel and drag down. See 2nd screen shot.

                  Please let us know if you need further assistance.
                  Attached Files
                  Alan P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks Alan. You code and instruction work well.

                    One more question, what is NT's code to plot executions on chart? I like the placement of up, down, left, right arrows, and text. Could you share the code that plots arrows and text with me? See the attachment for what I meant.


                    Originally posted by NinjaTrader_AlanP View Post
                    Hello istock999,

                    Attached is an indicator which will plot arrows on the input series and panel its applied to.

                    You could see the attached screen shot of how I set it up to draw on the 2nd panel.

                    The quickest way to minimize a panel would be to click the top boarder of the panel and drag down. See 2nd screen shot.

                    Please let us know if you need further assistance.
                    Attached Files

                    Comment


                      #11
                      Hello istock999,

                      Thanks for the reply.

                      I can not provide the source code, but this can be done using Draw.ArrowUp/Down and Draw.Text. It is also possible to draw the small triangle at the price point with Draw.Triangle.

                      Please let me know if I can assist further.
                      Chris L.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by maybeimnotrader, Yesterday, 05:46 PM
                      2 responses
                      21 views
                      0 likes
                      Last Post maybeimnotrader  
                      Started by adeelshahzad, Today, 03:54 AM
                      5 responses
                      32 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by stafe, 04-15-2024, 08:34 PM
                      7 responses
                      32 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by merzo, 06-25-2023, 02:19 AM
                      10 responses
                      823 views
                      1 like
                      Last Post NinjaTrader_ChristopherJ  
                      Started by frankthearm, Today, 09:08 AM
                      5 responses
                      22 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Working...
                      X