Iam struggeling with adding volumetric data to a NT strategy. I used the AddVolumetric in state.configure, but somehow it doesnt get the data. I thing the issue is further below in the code where I call e.g. the MaxDelta with GetMaximumPositiveDelta.
namespace NinjaTrader.NinjaScript.Strategies
{
public class DeltaEU : Strategy
{
private double DeltaBar {get;set;}
private double MaxDelta {get;set;}
private double MinDelta {get;set;}
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"DeltaEU";
Name = "DeltaEU";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.WaitUntilFlat;
TimeInForce = TimeInForce.Gtc;
TraceOrders = false;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
}
else if (State == State.Configure)
{
AddVolumetric("FDAX 03-25", BarsPeriodType.Minute, 1, VolumetricDeltaType.BidAsk, 1);
}
else if (State == State.DataLoaded)
{
DeltaBar = BarDelta();
MaxDelta = GetMaximumPositiveDelta();
MinDelta = GetMaximumNegativeDelta();
}
}

Comment