Specifically regarding the AddDataSeries entry seen here,
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?addchartindicator.htm
Obviously I must specify that the DynamicTickingES must be applied to a chart of an ES however I am not finding the Best Practice for doing so...
Please correct me if I am misunderstanding the situation or if it was explained somewhere else as I often overlook such details.
So to summarize once I have added another data series to a strategy how do I apply an Indicator to this secondary data series "ES 1000 tick" and how should the strategy read the Boolean values of this ES indicator from the ES 1000 tick data series and the chart of the security of which the strategy will execute?
#region Using declarations
#endregion
//This namespace holds Strategies in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Strategies
{
public class DynamicTrendPhase : Strategy
{
private DynamicTickingES dynamicTickingES;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"The Trend Scale is to be modeled as an Consolidation with a Distribution with a Dynamic Phase... The counter-phase distribution will be neglected for fear of poor choppy price action";
Name = "DynamicTrendPhase";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 300;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.Infinite;//TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.High;
OrderFillResolutionType = BarsPeriodType.Tick;
OrderFillResolutionValue = 1;
Slippage = 0;
StartBehavior = StartBehavior.WaitUntilFlat;
TimeInForce = TimeInForce.Gtc;
TraceOrders = true;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 100;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
}
else if (State == State.Configure)
{
AddDataSeries("ES", Data.BarsPeriodType.Tick, 1000, Data.MarketDataType.Last);
}
else if (State == State.DataLoaded)
{
ClearOutputWindow();
/// HOW do I use this when it is NOT a chart indicator?????
dynamicTickingES = AddChartIndicator(DynamicTickingES("ES", Data.BarsPeriodType.Tick, 1000, Data.MarketDataType.Last));
/// I dont see any relevant functions for dynamicTickingES = new AddIndicator
}
}
protected override void OnBarUpdate()
{
if ( DynamicTrendScaleConstantVWMA(VWMAcrossStabilizeDelay,PromptPeriodVWMA,FullPeriodVWMA).esUp[0] )
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}
if ( DynamicTrendScaleConstantVWMA(VWMAcrossStabilizeDelay,PromptPeriodVWMA,FullPeriodVWMA).esDown[0] )
{
EnterShort(Convert.ToInt32(DefaultQuantity), "");
}
​


Comment