NexusFi: Find Your Edge


Home Menu

 





Indicator performance bottleneck


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Adamus with 8 posts (1 thanks)
    2. looks_two ratfink with 6 posts (3 thanks)
    3. looks_3 cory with 5 posts (3 thanks)
    4. looks_4 Tasker_182 with 2 posts (0 thanks)
      Best Posters
    1. looks_one Zondor with 1 thanks per post
    2. looks_two cory with 0.6 thanks per post
    3. looks_3 ratfink with 0.5 thanks per post
    4. looks_4 Koepisch with 0.5 thanks per post
    1. trending_up 6,895 views
    2. thumb_up 9 thanks given
    3. group 4 followers
    1. forum 24 posts
    2. attach_file 1 attachments




 
Search this Thread

Indicator performance bottleneck

  #21 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,401


cory View Post
use FirstTickOfBar so you don't have to set CalcOnbarclose=true.

I understand that but my point is that your example code had CalculateOnBarClose = true, in the initialize section. Seems like a conflict.

Be yourself; everyone else is already taken. Oscar Wilde
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #22 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


Tasker_182 View Post
I understand that but my point is that your example code had CalculateOnBarClose = true, in the initialize section. Seems like a conflict.

the best practice is having CalculateOnBarClose = true first, see how long it takes before turn it off.

Reply With Quote
  #23 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425



Tasker_182 View Post
I understand that but my point is that your example code had CalculateOnBarClose = true, in the initialize section. Seems like a conflict.

No conflict, when Ninja says 'of no value' they just mean if CalculateOnBarClose is true then it is redundant. As a general performance tip, simple conditional tests are ultra fast operations, to be used in advance of anything else.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #24 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789


Koepisch View Post
Nice coding so far. You can test that you don't call the Get.. functions every time. If you call it 2 times for 2 consecutive IDXs then you can interpolate the other values.

Awesome tip! Unless I screwed up somewhere with the timings I recorded, my inner loop dropped from average 75 microsecs to 15 microsecs.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #25 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

If running on COBC false you can reduce the number of executions of OnBarUpdate by at least 70% by rejecting those price ticks that have the same price as the preceding tick and are not FirstTickOfBar.

if close[0]=previous close and NOT FirstTickOfBar return....

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.”
Prof. Albert Bartlett
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on December 9, 2013


© 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