The sample code are as followed:
protected override void OnBarUpdate()
{
if (State == State.Historical)
return;
if (entryOrder == null && ToTime(Time[0]) >= 90000)
{
if (GetCurrentBid() > 50
&& GetCurrentBid() <51
&& longEnabled == true)
{ // Go Long
entryOrder = EnterLong (1,Name);
//Print("JQ OnBarUpdate entryOrder = " + entryOrder);
}
else
if (GetCurrentAsk() < ShortMaxEntry
&& GetCurrentAsk() > ShortMinEntry
&& shortEnabled == true)
// Go Short
entryOrder = EnterShort (1,Name);
else
{
SetState(State.Terminated);
Print("Condition not met. Disabling " + Name + " Strategy" + " " + State + " " + ToTime(Time[0]));
}
}
The SetState code does fires and the "Enabled" checkbox does get unchecked, however, when I go to edit the strategy, I get the following message:
A sample video of this is provided below:
Can someone let me know if this is a bug in NT 8 beta 11 or is my code incorrect to disable the strategy?
Comment