NexusFi: Find Your Edge


Home Menu

 





NT7 custom user code causing memory leak


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one syxforex with 19 posts (3 thanks)
    2. looks_two ThatManFromTexas with 7 posts (1 thanks)
    3. looks_3 Fat Tails with 7 posts (8 thanks)
    4. looks_4 eman with 6 posts (3 thanks)
      Best Posters
    1. looks_one bnichols with 1.5 thanks per post
    2. looks_two Fat Tails with 1.1 thanks per post
    3. looks_3 eman with 0.5 thanks per post
    4. looks_4 syxforex with 0.2 thanks per post
    1. trending_up 17,526 views
    2. thumb_up 19 thanks given
    3. group 8 followers
    1. forum 49 posts
    2. attach_file 1 attachments




 
Search this Thread
  #41 (permalink)
 
Silver Dragon's Avatar
 Silver Dragon 
Cincinnati Ohio
Legendary Master Data Manipulator
 
Experience: Intermediate
Platform: TastyWorks / NT
Broker: TastyWorks /NT
Trading: FX, Stocks, Options
Posts: 2,107 since Feb 2011
Thanks Given: 6,422
Thanks Received: 5,238


Fat Tails View Post
Also when the paint bars leak you would probably see that on your chart.


@Fat Tails

ROTFLMAO!! Made my day!

nosce te ipsum

You make your own opportunities in life.
Visit my NexusFi Trade Journal Reply With Quote
  #42 (permalink)
 bobc635 
Tucson
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage5
Trading: CL, YM
Posts: 209 since Jan 2011
Thanks Given: 137
Thanks Received: 233

Thanks Eman, I too have seen some memory issues with the Momentum bars. Do you have a fix for that yet?
In trying to isolate the problem, I ran the charts normal and all was good. Then I paused the replay and added the Momentum and whamo....mem starts going crazy and NT is not functioning at all. I hate to do a hard NT shutdown, but that is the only way to get it back.

Thx
Bob



eman View Post
as per my potential offending code, i'm trying to get an answer from NinjaTrader directly:
clarify Add() in BarsType - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

this is untested, but if you're still working with MomentumBars, try changing this code (approx line 114):
 
Code
// close current bar; volume included for on-touch only
UpdateBar(bars, bar.Open, (maxCompare > 0 ? thisClose : bar.High), (minCompare < 0 ? thisClose : bar.Low), thisClose, time, (GapSetting == 3 ? volume : 0), isRealtime);
old code may have been overstating volume. not sure that would cause a leak, per se, but i guess it depends on how the indicator was coded.

you may also want to check this line (approx line 138):
 
Code
// add new bar; include volume once (except for on-touch), then create phantom bars
AddBar(bars, thisOpen, (maxCompare > 0 ? thisClose : thisOpen), (minCompare < 0 ? thisClose : thisOpen), thisClose, time, (GapSetting != 3 && newBar ? volume : 0), isRealtime);
basically, any reference to bar.Volume is suspect, and those are the only two places where that may have appeared.

the only thing that perplexes me is that volumeCount (used in Kagi, for example) is used for both AddBar() and UpdateBar() calls. so i guess it's possible that UpdateBar() does all kinds of magic under the hood.

best to get a straight answer from the source. working on it.

cheers,
-e


Reply With Quote
  #43 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,356


bobc635 View Post
Thanks Eman, I too have seen some memory issues with the Momentum bars. Do you have a fix for that yet?
In trying to isolate the problem, I ran the charts normal and all was good. Then I paused the replay and added the Momentum and whamo....mem starts going crazy and NT is not functioning at all. I hate to do a hard NT shutdown, but that is the only way to get it back.

Thx
Bob

@bobc635

What settings are you using?

I use ....



and have had no issues.

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
  #44 (permalink)
 bobc635 
Tucson
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage5
Trading: CL, YM
Posts: 209 since Jan 2011
Thanks Given: 137
Thanks Received: 233

Wow...maybe I grabbed an old version.... I am running r589 ( I like having rev controlled indis), so I only have R (I use 5) and Gap Setting (I use 2).... What version are you running?

BTW, my son is in Houston... he loves it...coming to visit in Nov for the F1 race in Austin

Thanks



ThatManFromTexas View Post
@bobc635

What settings are you using?

I use ....



and have had no issues.


Reply With Quote
  #45 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,356


bobc635 View Post
Wow...maybe I grabbed an old version.... I am running r589 ( I like having rev controlled indis), so I only have R (I use 5) and Gap Setting (I use 2).... What version are you running?

BTW, my son is in Houston... he loves it...coming to visit in Nov for the F1 race in Austin

Thanks

r809

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
Thanked by:
  #46 (permalink)
 eman 
Galveston ,TX
 
Experience: Intermediate
Platform: NT7
Broker: Zaner
Trading: Futures
Posts: 386 since Mar 2010
Thanks Given: 364
Thanks Received: 435

the last version on futures.io (formerly BMT) is r809.

the latest version is r860 but there are no logical changes between r809 and r860 - just the addition of the GPL license so it is free-for-all.

i'm still investigating the memory leak issue but haven't had a chance to fully test the proposed code above to see if that cures the problem.

a new version is due out next week which will include extra public properties (requested by indicator developers), a patch for volume (mentioned previously in this thread), and a few other goodies as time permits.

cheers,
-e

Reply With Quote
Thanked by:
  #47 (permalink)
 bobc635 
Tucson
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage5
Trading: CL, YM
Posts: 209 since Jan 2011
Thanks Given: 137
Thanks Received: 233

I downloaded the newrt version and it seems to be stable so far...will test it in replay tonight....

Thanks



bobc635 View Post
Wow...maybe I grabbed an old version.... I am running r589 ( I like having rev controlled indis), so I only have R (I use 5) and Gap Setting (I use 2).... What version are you running?

BTW, my son is in Houston... he loves it...coming to visit in Nov for the F1 race in Austin

Thanks


ThatManFromTexas View Post
r809


Reply With Quote
  #48 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508


Fat Tails View Post

For every indicator that you install on NinjaTrader the Initialize() section is executed, even when the indicator is not set up on a chart. This means that any indicator, which you have downloaded into bin -> Custom -> Indicator folder can create the problem. A new installation of NinjaTrader has no impact on the problems.

Best you rename your folder Documents -> NinjaTrader 7 to NinjaTrader 7 old (do not delete it, if you just rename it your decision is reversible). NinjaTrader will then create a new clean folder. You will still be able to copy your indicators, chart and workspace templates to the new installation, just instrument settings and session templates will be lost, as they are not stored separately.

Would this slow NT7 down? I downloaded many indicators and coded many others. I prolly have 100-200 or more custom indicators in NT7.

Visit my NexusFi Trade Journal Reply With Quote
  #49 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,104


mmaker View Post
Would this slow NT7 down? I downloaded many indicators and coded many others. I prolly have 100-200 or more custom indicators in NT7.

This slows down the compilation process. It also causes an additional waiting time when you add indicators to your chart or when you edit any indicator. It may halt NinjaTrader, if only one of our 200 indicators has a bug in the Initialize() section.

It will not affect the chart while it is running, as the Initialize() section of all indicator is only being executed when a new indicator is added to your chart. Once your chart is up and running, there should be no impact.

Reply With Quote
  #50 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508


Fat Tails View Post
This slows down the compilation process. It also causes an additional waiting time when you add indicators to your chart or when you edit any indicator. It may halt NinjaTrader, if only one of our 200 indicators has a bug in the Initialize() section.

It will not affect the chart while it is running, as the Initialize() section of all indicator is only being executed when a new indicator is added to your chart. Once your chart is up and running, there should be no impact.

Appreciate your response. Also Thanks for your work on SuperTrend.

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on November 21, 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