Skip to content

Instantly share code, notes, and snippets.

@DexterHaslem
Created July 10, 2012 16:54
Show Gist options
  • Save DexterHaslem/3084661 to your computer and use it in GitHub Desktop.
Save DexterHaslem/3084661 to your computer and use it in GitHub Desktop.
runtime indicator
protected override void OnBarUpdate()
{
string indicator = "EMA";
Type indicatorType = Type.GetType("NinjaTrader.Indicator." + indicator);
IndicatorBase indicatorBase = (IndicatorBase) Activator.CreateInstance(indicatorType);
Print(indicatorBase.GetHashCode() + ":" + indicatorBase.GetType().FullName);
indicatorBase.BarsRequired = BarsRequired;
indicatorBase.CalculateOnBarClose = CalculateOnBarClose;
indicatorBase.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicatorBase.MaximumBarsLookBack = MaximumBarsLookBack;
indicatorBase.Input = Input;
indicatorBase.SetUp();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment