NexusFi: Find Your Edge


Home Menu

 





Heap corrupt in NT 7


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one rleplae with 15 posts (7 thanks)
    2. looks_two sam028 with 4 posts (0 thanks)
    3. looks_3 Rory with 3 posts (0 thanks)
    4. looks_4 UpsideDown with 1 posts (0 thanks)
    1. trending_up 6,541 views
    2. thumb_up 7 thanks given
    3. group 4 followers
    1. forum 22 posts
    2. attach_file 3 attachments




 
Search this Thread

Heap corrupt in NT 7

  #11 (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


sam028 View Post
@rleplae, you should try to write you own ATI: a strategy listening to a socket port and executing the order with "normal" NinjaScript functions.
Not perfect on an intellectual point of view but not very difficult.

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.

Through ATI alone this was not possible.

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

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quant vue
Trading Reviews and Vendors
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
 
  #12 (permalink)
UpsideDown
Utrecht, Netherlands
 
Posts: 26 since Jun 2016
Thanks Given: 1
Thanks Received: 18

Nothing in the log or trace files? Just died?

I'd try removing indicators one by one. It's an extendable platform - not everyone that extends it knows what they are doing....

Reply With Quote
  #13 (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



UpsideDown View Post
Nothing in the log or trace files? Just died?

I'd try removing indicators one by one. It's an extendable platform - not everyone that extends it knows what they are doing....

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

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #14 (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

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()

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #15 (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

NT support recommends to restart at least once a day, if not issues can occur...

Curious if @sam028 is also restarting NT on his servers for customers ?
and if he can stop/start it automatically ?

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #16 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


rleplae View Post
NT support recommends to restart at least once a day, if not issues can occur...

Curious if @sam028 is also restarting NT on his servers for customers ?
and if he can stop/start it automatically ?

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?

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #17 (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


sam028 View Post
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.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #18 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


rleplae View Post
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.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #19 (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


sam028 View Post
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.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #20 (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


Completely restarted from scratch this morning.

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()

An exception that is not caught ?

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on June 30, 2016


© 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