Why is this indicator loading so slowly ? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Why is this indicator loading so slowly ?
Updated: Views / Replies:3,187 / 17
Created: by max-td Attachments:9

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 9  
 
Thread Tools Search this Thread
 

Why is this indicator loading so slowly ?

  #1 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

Why is this indicator loading so slowly ?

hi coders !

i have attached 2 indicators that are not very different in what they do.
also its nearly the same plots + code-lines.
but their loading-time very very differently when ading them in a chart.

my question is : Why is this VolatilityStop- indicator loading so slowly with high CPU-usage ?

i cant find the reason in the code by myself - but i would love to find it out

any ideas ?

also a question : will this "loading so slowly" eat more recources in realtime-action than a fast loading one when i use the indicator in a strategy ?
or do you think its only the first initial loading that takes so much time + cpupower ?

special Qs for special guys i think

looking forward to intersting ideas !

VolatilityStop = slow loading
ATR-Trailer = fast loading

BTW - thats all NT6,5 stuff.

.

max-td
Attached Files
Register to download File Type: cs VolatilityStop.cs (11.7 KB, 22 views)
Register to download File Type: cs ATRTrailing.cs (11.5 KB, 20 views)
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,599 received
Forum Reputation: Legendary


Easy answer:

The two indicators are coded in a different way!



If this answer did not help you, you need to check the code in lines 81 and 102 of the volatilitystop indicator. "counter" may take a higher value than "period" as used by ATRTrailing. The MAX and MIN methods are the public servants of the NinjaTrader methods, they are executing the job you ask, but slowly.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #4 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

hmmm

---

max-td
Reply With Quote
 
  #5 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

that would mean you think its mainly caused from this different :


SigClose = MIN (Low, (period)) [0] ;


against


SignalClose = MIN (Close, (counter)) [0] ;



where period is a fixed variable
and
counter is a variable that is calculated new each time

max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #6 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

BINGO !

thats really the point !

i changed counter in this - SignalClose = MIN (Close, (counter)) [0] ; and in the visaversa-line --
into a static variable for testing and it loads fast as hell

for shure it plots an other line too - but that wasnt the question now.

ok - thanks a bunch for the input!

so my second question was if this indicator makes also a strategy permanently more heavy than a fast loading one while running realtime ?
or does this only affect the loading-process ?

max-td
Reply With Quote
 
  #7 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,599 received
Forum Reputation: Legendary

I think the main point is that counter can take much larger values than period. I do not think that the access of a dynamically defined variable is slower than the access of a static variable. You could try to substitute counter with a large fixed number and see what happens.

Reply With Quote
 
  #8 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

hmm
as i see it in the code , counter is only set to 0 / 1 / 2 -- depending on conditions - not more.


and if i insert 150 as fix number - loads fast as hell too.

max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #9 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,599 received
Forum Reputation: Legendary


max-td View Post
hmm
as i see it in the code , counter is only set to 0 / 1 / 2 -- depending on conditions - not more.


and if i insert 150 as fix number - loads fast as hell too.


Interesting, learned something.

Reply With Quote
 
  #10 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


hehe me too !

i dont have to find out the deeper why now ... but this i like to get answered if possible :

so my second question was if this indicator makes also a strategy permanently more heavy than a fast loading one while running realtime ?
or does this only affect the loading-process ?

any ideas ?

max-td
Reply With Quote

Reply



futures io > > > > > Why is this indicator loading so slowly ?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ninja hangs up on loading data aligator Traders Hideout 23 October 26th, 2013 05:33 PM
Custom NT indicator has stopped auto-loading with strategy, cache? drwylde NinjaTrader 1 July 9th, 2011 09:11 PM
NT crashes "Error on loading chart" john924 NinjaTrader 7 September 7th, 2010 01:49 AM
if Ninja has issue loading historical data, here is fix emini_Holy_Grail Traders Hideout 0 January 22nd, 2010 11:40 AM


All times are GMT -4. The time now is 05:11 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-11 in 0.12 seconds with 20 queries on phoenix via your IP 54.226.132.197