NexusFi: Find Your Edge


Home Menu

 





Import Executions into NT7


Discussion in NinjaTrader

Updated
    1. trending_up 1,730 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Import Executions into NT7

  #1 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 485 since Apr 2012
Thanks Given: 667
Thanks Received: 648

Hi Guys
Do you think there is a practical way of importing a full database of executions into NT7 for displaying and feeding the performance tab reports and graphs?

I wish to import all my 2013 trades in NT7 as I did not connect it everyday to my broker's account, and was trading from outside NT7 on my any occasions...

I've found in the user's guide a very unpractical and manual way of inserting executions in the system; that works perhaps for adding a couple of trades, but can't do for 500+ trades unfortunately.

Can we force this through customized programming, or manual modifications of the underlying DB files?

Thanks
Fadi

Successful people will do what unsuccessful people won't or can't do!
Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

It might be possible in feeding the nt_execution table. But it's a bit tricky, as you'll need to find the instrument id, and so on.


Fadi View Post
Hi Guys
Do you think there is a practical way of importing a full database of executions into NT7 for displaying and feeding the performance tab reports and graphs?

I wish to import all my 2013 trades in NT7 as I did not connect it everyday to my broker's account, and was trading from outside NT7 on my any occasions...

I've found in the user's guide a very unpractical and manual way of inserting executions in the system; that works perhaps for adding a couple of trades, but can't do for 500+ trades unfortunately.

Can we force this through customized programming, or manual modifications of the underlying DB files?

Thanks
Fadi


Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #3 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 485 since Apr 2012
Thanks Given: 667
Thanks Received: 648


Do you know where can I find the nt_execution table?

Successful people will do what unsuccessful people won't or can't do!
Follow me on Twitter Started this thread Reply With Quote
  #4 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

It's in ninjatrader.sdf .

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #5 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 485 since Apr 2012
Thanks Given: 667
Thanks Received: 648

Thank you Sam
File located, but trying to open it with CompactView, and having some issues...
Are you editing this sdf file with Visual studio usually?

Successful people will do what unsuccessful people won't or can't do!
Follow me on Twitter Started this thread Reply With Quote
  #6 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

See a skeleton, used for an external program wrote in C# with VS :

 
Code
                            
            string path Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Ninjatrader 7\db";

            const 
string dbName "NinjaTrader.sdf";
            
SqlCeConnection c;
            
= new SqlCeConnection("DataSource=" path + @"\" + dbName + ";File Mode=Read Only;Temp Path=" + path);
            c.Open();

            string query = "
select a.marketposition,a.quantity,a.price,b.expiry,c.name,a.executiontime,d.name,a.pos,a.counterid" +
                " 
from nt_execution a,nt_instrument b,nt_masterinstrument c,nt_account d" +
                " 
where a.instrument=b.id and b.masterinstrument=c.id and a.account=d.id" +
                " 
order by a.executiontime";

            SqlCeCommand cmdGet = new SqlCeCommand(query, c);
            SqlCeDataReader reader;

            reader = cmdGet.ExecuteReader();

            while (reader.Read())
            {
                int m = (int)reader[0]; // L ou S
.... 
But like I wrote earlier, a bit tricky...

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Fadi View Post
Thank you Sam
File located, but trying to open it with CompactView, and having some issues...
Are you editing this sdf file with Visual studio usually?

Just in case if anybody else is bumping into the same problem : "Unable to open database : Internal Error : cannot open the shared memory region."... I'm writing it down here for the record... as other members may bump into this also, and find the answer helpful.

Took me 1/2 day to figure it out (thanks to MSF with their clear error message), as i don't have this on my other machine and only on this machine. I did a lot of things to nail the problem down. Uninstalling all the SQL xxx drivers and programs (i don't use it), only installing sql ce 3.5 (be sure to focus on the right version, or NT will crash after many orders) to find the the problem is exactly the same

The break-through came when i copied the "ninjatrader.sdf" file to my desktop, there it opens without any problem/error, conclusion, it's a rights issue (the error message doesn't tell you so)

The final solution is to run compactview as admin (right click, run as..)

I have this only on one of my machines...

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on January 14, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts