Announcement

Collapse
No announcement yet.

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.

    https://ninjatrader.com/support/help...eries_time.htm
    https://ninjatrader.com/support/help...ightsub=totime
    https://ninjatrader.com/support/help...hlightsub=time

    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.

        https://ninjatrader.com/support/help.../importing.htm

        https://ninjatrader.com/support/help...connection.htm

        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
          https://futures.io/elite-circle/4474...tml#post716029
          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 zacharydw00, Today, 11:13 PM
          0 responses
          2 views
          0 likes
          Last Post zacharydw00  
          Started by luxurious_04, Today, 10:55 PM
          0 responses
          1 view
          0 likes
          Last Post luxurious_04  
          Started by timmbbo, Today, 10:27 PM
          0 responses
          2 views
          0 likes
          Last Post timmbbo
          by timmbbo
           
          Started by 7robert, Today, 07:48 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_EricB  
          Started by saltminer, Today, 06:32 PM
          0 responses
          6 views
          0 likes
          Last Post saltminer  
          Working...
          X