Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Performance of indicator with flexible input
Collapse
X
-
You're welcome, Rollins. Grab the enum and CalcMovingAverage() method out of the StochasticsWithSmoothing.cs file and I think you'll find it will help.
-
Thanks for the suggestion and the code KBJ.
The performance in the MAV 1.2 version with the indicator class is worse then the original one.
Just setting the indicator on Initialize() was my first optimization idea, but it doesn't work, as seen in MAV_v1.1 and the quote I posted.
Of course it might work with the right adjustments, but I don't know what they should be.
What I am wondering about is how wasteful such an indicator really is, but that's something for the NT guys because it requires knowledge of how it's handled internally.
MAV_1.0 works fine, if anyone wants to use it.
CheersLast edited by Rollins; 11-04-2007, 11:37 PM.
Leave a comment:
-
That's a clever technique.
But why not move the initialization of "indicator" to the Initialize() method?
That's probably what's making it slow... it doesn't have to be done for every bar.
By the way, there's a full list of these moving averages in this post: http://www.ninjatrader-support.com/v...ht=Stochastics
I also based the selection of moving average types in StochasticsWithSmoothing on Gumphrie's enumeration example, and I've now updated it to use the Indicator class, like is in your code. I don't know why but somehow or other that refinement escaped me when I originally wrote this code, but I like this much better.
You might want to steal the enum and CalcMovingAverage() method from that file, it might save you a little work. And it is well commented.
Leave a comment:
-
Performance of indicator with flexible input
Hi,
I made my indicators a lot more flexible by writing a base indicator that I feed all the data and which knows by passing an int parameter which MA to apply.
I got the idea when I looked at how Gumphrie used enums and with some trying I was able to come up with a nice use for them.
Now what I' really love to know is, how much does this degrade performance/memory use being a deoptimzation. Possible ways to keep this in check.
To get a bit of a performance increase I thought I'd try something else.
You can see it in the MAV 1.1, it never throws and exception an never calls OnBarUpdate, so I get nada nothing zilch.
04.11.2007 15:32:25|3|4|Failed to call method 'Initialize' for indicator 'MAxOver': Unable to cast object of type 'NinjaTrader.Indicator.DataSeriesHelper' to type 'NinjaTrader.Data.Bars'.
04.11.2007 15:33:23|3|4|Error on calling the 'OnBarUpdate' method for indicator 'IndicatorX' on bar 0: Unable to cast object of type 'NinjaTrader.Data.DataSeries' to type 'NinjaTrader.Data.Bars'.
Actually the MAV 1.2 version is much worse, chart was stuck for a second after dragging.
Thanks in advance and cheers,
RollinsLast edited by Rollins; 11-04-2007, 09:54 AM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by GloriaRineye, Yesterday, 11:59 PM
|
0 responses
1 view
0 likes
|
Last Post
![]()
by GloriaRineye
Yesterday, 11:59 PM
|
||
Started by Paul Penton, Yesterday, 10:42 PM
|
0 responses
1 view
0 likes
|
Last Post
![]()
by Paul Penton
Yesterday, 10:42 PM
|
||
Started by mo_fi, Yesterday, 10:08 PM
|
0 responses
2 views
0 likes
|
Last Post
![]()
by mo_fi
Yesterday, 10:08 PM
|
||
Started by Oracletrades, Yesterday, 10:02 PM
|
0 responses
1 view
0 likes
|
Last Post
![]()
by Oracletrades
Yesterday, 10:02 PM
|
||
Started by jeronymite, Yesterday, 09:15 PM
|
0 responses
2 views
0 likes
|
Last Post
![]()
by jeronymite
Yesterday, 09:15 PM
|
Leave a comment: