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,192 / 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 ?

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


max-td View Post
any ideas ?

I am . Have no at all.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #12 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


max-td View Post
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 ?

I don't know if it's relevant to this discussion, but Visual Studio can profile code for an more advanced analysis of an indicator.

See the wiki post How-to profile NinjaTrader code with Visual Studio 2010 - Big Mike's Day Trading Forum

Or am I missing the point? In that case, sorry.

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


sounds like a good idea Jura !

maybe i should have a look at this one winter-day
but i do not even have this VS at the moment.

is it free available ? - ok - wrong question - its nothing free i saw in the wiki-post

max-td

Last edited by max-td; September 8th, 2010 at 05:03 AM.
Reply With Quote
 
  #14 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


max-td View Post
sounds like a good idea Jura !

maybe i should have a look at this one winter-day
but i do not even have this VS at the moment.

is it free available ? - ok - wrong question - its nothing free i saw in the wiki-post

Well, the Express Edition of Visual Studio is free available (after registration), but (as far as I know) that version doesn't support the 'performance profiling'.

I'm not an Visual Studio expert (not even an intermediate user lol) but I looked at your question. If I understand it correctly, you where wondering if the strategy would be an continuous drag on a system resources?

Because I don't have your strategy (or settings for that matter), I did the following in NinjaTrader while Visual Studio was profiling in the background:
1. Started up NinjaTrader 7.0.0.20 (empty workspace),
2. Opened a 5 minute chart (with 30 days of data),
3. Connected to Interactive Brokers,
4. Let the chart update in real-time for a few minutes,
5. Added multiple indicators (with CalculateOnBarClose on false),
6. Let the chart and it's indicators update in real-time for a few minutes,
7. Exited NinjaTrader.

The idea was that, if multiple indicators lead to higher CPU usage, you would see an higher level of CPU usage after adding the indicators than you saw before adding the indicators. Please see the screen with the CPU chart from Visual Studio: I can't see any noteworthy higher CPU usage after adding of the indicator. I've also added a chart which shows wich indicators I put on the real-time chart.

But I do not know how to read the various processes as is demonstrated in the wiki article, so perhaps these findings are biased or so.

Perhaps @MXASJ or @gomi can provide some useful insights.

Regards,

Attached Thumbnails
Why is this indicator loading so slowly ?-chart.png   Why is this indicator loading so slowly ?-lines.png   Why is this indicator loading so slowly ?-vsoutput1.png  
Reply With Quote
The following user says Thank You to Jura for this post:
 
  #15 (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

wow !
so you have the full VS it seems.

for me it was more a basic question if this indicator (VolatilityStop from below) would use the high loading- (initialize-) power also in permanently running stat in strategy usage.
because i am not shure WHY its using so long loadingtime.
just to understand a bit more of those coding-stuff.

MXA says this :
I have strats that take about 10 seconds to initialize, but then consume very liitle.

so i think that answers also for my Q : it may be the initializing process only. - but its not tested yet.

if you like to ad the VolatilityStop (see in the first post) in your testing-setup + watch whats going on - that would be interesting!

maybe i do a small strategy with the VolatilityStop later to also test it with strategy running.
well - if YOU are willing to do more tests ! -- i dont have VS on my end ... mxa also not - he has only a small version.

testing could be done with pressing F5 to reload all the stuff in the chart.
it can be cpompared with having one chart with those several indicators in + press F5
and having another chart with tose several indis PLUS the vola-stop in ther + press F5
and watch the graohs --- just as idea

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

Some suggestions to cope with increased CPU load

There are specific NinjaTrader methods that cause problems with CPU usage

(1) The worst problem is caused by custom plots that execute heavy calculations. The reason is that the plot is recalculated for every incoming tick, even if an indicator is set to CalculateOnBarClose = true; Proper coding with NInjaTrader requires that custom plots are kept as slim as possible.

(2) Some of the Draw() Methods of NinjaTrader are badly implemented, so you need to reduce the lookback period of any indicator that draws on the chart. I have had huge problems with DrawRectangle(), DrawDiamond() and DrawArrowUp() etc. To reduce the lookback period of the indicator, you can just add a line to check for the date.

(3) Some of the other methods such as MAX() ,MIN() also cause problems.

(4) You can reduce the CPU load by putting some of the indicator code into a bracket after FirstTickOfBar

 
Code
 
if (FirstTickOfBar)
{
 
// enter code here that only needs to be excuted once for each bar, so the calculations will not be performed with every incoming tick...
 
}
These are the principal case that I have encountered. Of course you can use the sophisiticated methods of Zondor to further speed up your code.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #17 (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

yes fattails,
but we started with the 2 given indicators in post 1 - they are nearly the same but so different in loading-time+recources.

i dont want to explore all Ninja-deepness about this -- just still to looking at this VolatilityStop.

maybe in this direction the VS-testing bring us a bit more details in this special case - that was the idea now.

max-td
Reply With Quote
 
  #18 (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

OK - i made some simple strats with the indicator for testing :

it plosts 2 arrow if we have a cross of the Close above / below the VolaStop


- ____Vola_Bucks_02.cs = incl. the Original VolatilityStop + NO ploting

- ____Vola_Bucks_01_Plus_Plot.cs = incl. the Original VolatilityStop AND ploting on the chart


- ____Vola_Bucks_01_Minus_Count..cs = incl. the fast variation of the VolaStop - inpired by Fat Tails ideas - for testings only - + NO ploting on the chart


- VolatilityStop_Test_Tails.cs = here i replaced the variable "counter" in the MAX / MIN - calculations with a fix variable and it loads superfast now + used it in the strategy ____Vola_Bucks_01_Minus_Count..cs


The idea was if the strategys are very different compared to eachother in

1 - loading
2 - during live-running

looking at cpu-usage + analyses in VS

and if its possible to see wich section is responsible for this. ( hot lines or so ... )

as said Jura or other VS-owners , if you have fun with doing this or find it useful somehow.

max-td
Attached Files
Register to download File Type: cs ____Vola_Bucks_02.cs (1.9 KB, 4 views)
Register to download File Type: cs ____Vola_Bucks_01_Plus_Plot.cs (1.9 KB, 6 views)
Register to download File Type: cs ____Vola_Bucks_01_Minus_Count.cs (2.1 KB, 5 views)
Register to download File Type: cs VolatilityStop_Test_Tails.cs (11.3 KB, 7 views)
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)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

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 08:37 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-13 in 0.14 seconds with 20 queries on phoenix via your IP 54.160.245.121