Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi @sam028
I have now a working setup, which is stable and working well.
It is a mix of using the ATI interface to do any order creation, update, cancel and a direct link to the ninjatrader DB using SQLCE that provides me now with all functions i need. If I now manually update the stop or target in chart trader, the trading robot 'sees' this and takes that into account.
No nothing in the log, only in the windows even viewer, it is really the ninjatrader process going 'KO'
I did run it without charts and just injecting orders, so i know it comes from the ATI interface
I have been able to do a few tricks, to reduce the frequency, but once in a while it still happens
I'm now trying to 'temporize' the interface by add some delays to be able to understand where it comes from.
of course this doesn't look like very nice
Likely i will write my own broker link, to avoid this crashing platform.
Ninjatrader is normally able to 'sync' with the executions you put on the broker.
curious if that will crash also if too busy
I keep struggling with this issue.
Mostly in the night, around 04:00-05:00 my NinjaTrader will crash when an order is placed using ATI interface.
In the trace I can find the following :
2016-06-17 05:04:41:489 in OnUnhandledApplicationException
2016-06-17 05:04:41:508 *************** unhandled exception trapped ***************
2016-06-17 05:04:41:508 Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
2016-06-17 05:04:41:508 System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Data.SqlServerCe.NativeMethods.CoTaskMemFree(IntPtr ptr)
at System.Data.SqlServerCe.Accessor.Dispose()
at System.Data.SqlServerCe.Accessor.Finalize()
We don't have a direct access to our clients servers: we can stop/start/reboot/reset them but we can't log on to read their files or start/stop any program.
From what I know some users are never stopping Ninja, some others restart it every week-end but just in case. From what I remember from the Battle of the bots I kept Ninja running for months, with a dozen of running strategies.
For your custom stuff do you open the Ninja DB in read-only, and don't update it at all?
I de-actived the reading of the DB, so i'm sure it's not coming from there...
It is strange that NT support says that you should reboot at least once a day...
my custom stuff uses ATI, that is probably the main cause of the issue.
so my conclusion is somehow that NT is a bad platform for order routing, and execution
of orders that originate outside NT. It is nice for charting and some ATM programming.
Another option would be to use Interactive Brokers API and let the orders fall in NT in reverse sense using the sync function.
I'll stick with my previous idea here.
IB API is not very complex but with a fake strategy sending orders initiated by something else all will be seen as native Ninja orders. Then you could do some funny things like let your external program initiate the trade and let Ninja manage the exits.
That would also be simpler than basically rewriting an IB connector.
That fake strategy would have to do , order creation, cancel, update, status, etc.. very quicly this becomes also a piece of software and i would have to have it running on a chart for every instrument.
No indicators, just ATI interface sending orders.
NT just crashed again...
The error looks very ugly in the trace file :
2016-06-17 16:12:35:764 (IQfeed) Cbi.OrderStatusEventArgs.Process: Order='9b5e6c47f963408e807f6b2c83d0ecaf/Sim101' Name='Target1' New state=Filled Instrument='6B 09-16' Action=Sell Limit price=1.4291 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=1.4291 Error=NoError Native error=''
2016-06-17 16:12:35:802 *************** unhandled exception trapped ***************
2016-06-17 16:12:35:802 Object reference not set to an instance of an object.
2016-06-17 16:12:35:802 System.NullReferenceException: Object reference not set to an instance of an object.
at System.Data.SqlServerCe.Accessor.Dispose()
at System.Data.SqlServerCe.SqlCeCommand.CloseInternalCommand()
at System.Data.SqlServerCe.SqlCeCommand.set_Transaction(SqlCeTransaction value)
at System.Data.SqlServerCe.SqlCeConnection.ObjectLifeTimeTracker.Zombie(SqlCeTransaction tx)
at System.Data.SqlServerCe.SqlCeTransaction.Commit(CommitMode mode)
at Wilson.ORMapper.Transaction.Commit()
at NinjaTrader.Db.Globals.DBThreadProc()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()