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

Mapping trade on chart.

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

    Mapping trade on chart.

    Hi.
    I have a table of trades (file.txt).
    time-> entry. time-> exit. direction of the trade.
    I want to display these trades on a chart using the historical data of the past contract.
    implementation idea: run simulated trading at increased speed. and during these trades read data from the file.txt.
    if (platform==file(entry,exit,time)) put a marker of deals.
    the logic code is written in an external file in a language other than the platform, so I cannot use the strategy directly for the test ..
    question: is my reasoning about implementation correct or not?
    If yes:
    1. What nuances should I know about?
    2. What api do I need?
    3.How to set the maximum speed of simulated trades?
    if not true:
    1. how to solve this problem?

    #2
    Hello Danila,

    Thank you for the post.

    What you described is possible, or to read the file and then plot the results.

    There is a sample in the help guide of reading a text file, you could use a similar approach to get the data into NinjaTrader from either an indicator or strategy. https://ninjatrader.com/support/help...o_read_fro.htm

    To mark the chart you can use drawing objects: https://ninjatrader.com/support/help...t8/drawing.htm

    NinjaScript uses the Time object when processing bar data, you could use the Time from the bar data to compare against the times in your text file. It may be easiest to use the ToTime method for time comparisons depending on the format of the time in your file.





    The speed of the trades would be determined on how you read and process the data. You could read the data all at once and then plot it all at once. Alternatively you could read the data and then reference that data as the bars process to place the marking on the chart at the rate the script is running.

    The only way to have a variable rate of the script running would be in playback mode, otherwise the script would process based on the incoming data and selected bar series in realtime. Historical bars process at maximum speed meaning every historical bar is processed one after the other until realtime.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      hi Jesse. Thanks for answer.
      1. I want to test data for 5 months. I downloaded the candle data for this period.
      I looked at the instructions and see that I can import data at a time one day from the platform (and it takes a lot of time and I can't download data from past contracts).
      (tools-import -historical data-get the market to replay data))
      I don’t want to waste time on this. cause I already have data. I want to import data for several months from my file.txt.
      how to import data from my file?
      ps. why i need download data if it is already in the ninja trader's storage(historical)?? and one day at a time? What's the point?
      Last edited by Danila; 05-07-2021, 02:28 PM.

      Comment


        #4
        Hello Danila,

        For historical data you can see the following guide of how to format the data for import.

        The Playback data which can be downloaded 1 day at a time is not historical data, that is live data that was recorded so it is much larger. The data which you can import will be imported as less granular historical data. You can still use the playback connection to play through historical data but that is less granular than playback data.





        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          If you happen to be an Elite Member of futures.io RatFink posted a not perfect but really good start on an indicator that maps trades on screen like a strategy run would.

          HedgePlay


          futures io > Trading Community > The Elite Circle > rfkTradeMarks - trade execution lines for NT7 and NT8
          Hi ratfink, sometimes i have situations in which i have rectangles in the chart, whose source i can't find and which i can't erase. Sometimes the source area is longer back than data is loaded or as in my case where there is no possibility to mark the rectangle. Maybe you can integrate a button to delete all rectangles from this instrument? So you can easily go back to the original state. What do you think about it? In addition, many lines and other markers are deleted when the contract is changed. …

          File Type: zip rfkTradeMarks_2_1B1_NT7.zip (10.1 KB, 36 views)
          File Type: zip rfkTradeMarks_2_0B2_NT8.zip (7.3 KB, 75 views)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          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 michi08, 10-05-2018, 09:31 AM
          3 responses
          740 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          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