![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Member
Join Date: Jan 2008
Location: Wuppertal
Posts: 35
Thanks: 3
Thanked 0 times in 0 posts
|
Hi,
I have problems creating an indicator that updates properly if used with CalculateOnBarClose = false. Basically I modified a Stochastics to use different smoothing MA's: Code:
K.Set(kValue); // Smooth = SlowKperiod
switch (smoothType)
{
case 1:
dValue = EMA(K, PeriodD)[0];
break;
case 2:
dValue = InstTrend(K, PeriodD)[0];
break;
default:
dValue = SMA(K, PeriodD)[0];
break;
}
D.Set(dValue); // PeriodD = SlowDperiod
the DataSeries to be smoothed. If I use CalculateOnBarClose = true everything works fine with all three indicators. Input has these values for example: Quote:
ES: When using CalculateOnBarClose = false, the current value for K does not get passed on to the InstTrend Indicator and therefore the computations will be false: Quote:
However the system indicators EMA and SMA as well use Input[0] and do not seem to have any problems, even under tick by tick processing. What is missing?
Last edited by cbaer; 01-13-2009 at 07:16 PM.
|
||
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
Hi cbaer, please try removing all CalculateOnBarClose calls in the dependent scripts / methods and use only one call in the final indicator.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Identifying Close of Bar when CalculateOnBarClose = false | OnePutt | General Programming | 8 | 04-20-2011 11:20 AM |
| what really happens when calculateonbarclose = false | verge | Strategy Development | 9 | 07-28-2008 01:50 AM |
| MACD CalculateOnBarClose=false | mwyatt | Indicator Development | 1 | 01-10-2008 09:31 AM |
| custom Dataseries as indicator input, or input to indi through underlying strategy | Nathamus | General Programming | 3 | 08-30-2007 12:04 PM |
| Indicator line goes to zero when CalculateOnBarClose set to True | ThePatientOne | Indicator Development | 1 | 08-30-2007 11:42 AM |