I have attached a sample strategy/indicator " Bollinger_TripleState_v4NT8" from http://www.ninjatrader.com/support/f...catid=7&id=701
Problem:
As soon as I start trying to access Indicator values from strategy - Draw.Region stops working immediately.
As soon as I comment these couple of lines - Draw.Region starts working again.
I encountered it when trying to automate IchimokuCloud indicator in this thread as general question: http://ninjatrader.com/support/forum...ad.php?t=80327
However, now I see that it is a bug and is reproducible with other indicators as well.
Can you please confirm it on your side + include fix for this in a nearest Beta release...?
Please see attachment + snapshot below:
public class Ichimoku_Only : Strategy
{
private BollingerTripleState_V4NT8 bollinger;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "Ichimoku_Only";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = false;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.AdoptAccountPosition;
TimeInForce = TimeInForce.Gtc;
TraceOrders = false;
RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 52;
}
else if (State == State.Configure)
{
bollinger = BollingerTripleState_V4NT8(2, 14, 4, 8, false, true, true, 15);
AddChartIndicator(bollinger);
}
}
protected override void OnBarUpdate()
{
if (CurrentBar <= 52)
return;
//once these lines are uncommented - draw on strategy analyzer chart will stop working.
var x = bollinger.Lower[0];
var y = bollinger.Middle[0];
}
}
Thank you
Comment