NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-29-2010, 07:52 AM   #1
dave1992
Senior Member
 
Join Date: Nov 2008
Location: UK
Posts: 637
Thanks: 0
Thanked 1 time in 1 post
Default SMA efficiency

Hi,

In the supplied SMA code, I believe there are two Math.Min() calls that are unnecessary:

Code:
if (CurrentBar >= Period)
                    Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
else
                    Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
regards
Dave
dave1992 is offline  
Reply With Quote
Old 05-29-2010, 08:25 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,014 times in 995 posts
Default

Thanks Dave, we'll take a look into.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Efficiency eDanny General Programming 2 03-16-2010 11:39 AM
Exit Efficiency DangerBoy Miscellaneous Support 5 06-12-2009 01:19 PM
Entry/Exit Efficiency GorSvet Strategy Analyzer 3 01-29-2009 03:22 PM
Memory efficiency redwoood Suggestions And Feedback 9 04-09-2008 06:54 AM
K Efficiency Ratio Learning1 Indicator Development 1 08-01-2007 01:51 PM


All times are GMT -6. The time now is 12:03 AM.