Thanks,
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Coherency Test Indicator Conversion from 7 to 8
Collapse
X
-
Coherency Test Indicator Conversion from 7 to 8
Hi, I'm trying to convert the NT7 c-test indicator from the NinjaTrader user-app-share site to NT8 Format. I have partial converted the indicator, but not sure how to start changing the private IndicatorBase? I get errors at line 128. I'm attaching the conversion I have so far. Maybe someone could direct me. Once we get it, I will load it to the user-app-share site for all to use.
Thanks,Tags: None
-
Hi ChelseaB,
Yes that is exactly what the it does, calls other indicators. This is an indicator that i'm trying to convert to NT8. The NT7 Version is located on the NinjaTrader user-app-share site. This indicator is based on the C-test created by William Eckhardt. Its meant to help evaluate indicators based on a methodological test for dimensional coherency. I'm looking for direction with converting the lower part of the code, and I get an error at line 128. So...if anybody on the Forum could help guide me on this, I will post the indicator on the user-share site when its completed.
Thanks,
I have attached the NT7 Working Version and the NT8 I have so far.Attached Files
Comment
-
Hi woodyfox,
here is what I've come up with because Input cannot be assigned: create an instance of the indicator, make it set its default values and then invoke the regular indicator instantiation method with said parameter values.
This step seems fine but the coherence test fails.
Requires System.Reflection and System.Collections
Code:private IndicatorBase CreateInstance(string indicatorName, ISeries<double> inputSeries) { Type indicatorType = Type.GetType("NinjaTrader.NinjaScript.Indicators." + indicatorName); if (indicatorType == null) { return null; } IndicatorBase dummyIndicatorBase = (IndicatorBase) Activator.CreateInstance(indicatorType); dummyIndicatorBase.SetState(State.SetDefaults); MethodInfo indicatorMethod = GetType().GetMethods().First( method => indicatorName.Equals(method.Name) && method.GetParameters().FirstOrDefault(parameter => "input".Equals(parameter.Name.ToLower())) != null ); ArrayList parameterValues = new ArrayList(); foreach(var parameter in indicatorMethod.GetParameters()) { if("input".Equals(parameter.Name)) { parameterValues.Add(inputSeries); continue; } PropertyInfo propertyInfo = indicatorType.GetProperty(parameter.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase); parameterValues.Add(propertyInfo.GetValue(dummyIndicatorBase)); } IndicatorBase indicatorBase = (IndicatorBase)indicatorMethod.Invoke(this, parameterValues.ToArray()); indicatorBase.BarsRequiredToPlot = BarsRequiredToPlot; indicatorBase.Calculate = Calculate.OnBarClose; //indicatorBase.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicatorBase.MaximumBarsLookBack = MaximumBarsLookBack; //indicatorBase.Input = inputSeries; //Indicators.Add(indicatorBase); //indicatorBase.SetState(); return indicatorBase; }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
640 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
572 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment