Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

need for efficient export

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

    need for efficient export

    Dear Ninjatrader
    Please advise if exporting the following information using Kinetick EOD is possible programmatically:
    • entry/exit dates of the trade
    • close price of each bar between the 2 dates

    I do appreciate the solution to this can be:
    1. get the dates when looking at the trades summary,
    2. lookup the symbol and
    3. lookup the close prices from historical data on the web.
    However, I’d be doing it many times while in trading system research mode the above sequence would quickly become too cumbersome. Naturally, I’d want to streamline the process as much as possible and the best thing I can think of would be embedding such query or part of it into the strategy code if possible.
    Please advise of any ready solutions/examples available or direct to a good place to start. THANK YOU.

    #2
    Hello Ionaz,

    Thank you for your post.

    You would need to use IOrder functions in conjunction with System.IO to write or read to a text file.
    http://www.ninjatrader.com/support/h...tml?iorder.htm
    http://www.ninjatrader.com/support/f...ead.php?t=3477
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal

      Thank you for your post.
      Which function(s) would help me in retrieving each day’s Close price? I looked into the IOrder list of functions you shared - it's not quite obvious. I will be working with historic EOD Kinetick data when testing the systems.

      Also, Is there a way to export to excel instead of to a text file?

      Thanks
      Jonas

      Comment


        #4
        Ionaz,

        If you are just getting the close price of the bar then you would want to use Close[0]. When you run the backtest it will go through each day and get that closing price for the bar.

        Yes, you would need to use the Microsoft.Office.Interop DLL for the ability to write to an excel.
        http://msdn.microsoft.com/en-us/library/15s06t57.aspx
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi Cal

          Not sure this will give me what I need.
          As I need to export programatically closing prices of all bars within each backtested trade.

          Example:
          trade#1
          buy MSFT 22/01/2009 @ 18.05; sell MSFT 06/02/2009 @ 19.86
          I'd need to export programatically closing prices of MSFT between the dates shown. So there'd be 15 closing prices I'd need to programatically export as the trade lasted 15 days.

          I'd need to do the same for all the trades and export the data into one file.

          Not sure if relevant, but FYI: I've managed to achieve the list of all trades in one window after the backtest ends as per this thread and now want to go 1 step further and that is - be able to export the closing prices OF EACH BAR within ALL trades that took place.
          Last edited by ionaz; 01-14-2014, 12:48 AM.

          Comment


            #6
            Ionaz,

            There are a couple ways that you could do this for getting the the close price.
            You can test for when you are in a Position and then print or write the close prices of the position that it held.
            Code:
            if(Position.MarketPosition == MarketPosition.Long)
            Print(Close[0]);
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            650 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            577 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X