![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2008
Location: UK
Posts: 637
Thanks: 0
Thanked 1 time in 1 post
|
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));
Dave |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,014 times in 995 posts
|
Thanks Dave, we'll take a look into.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |