What is important, is that with chart setup for 5 minute bars, and IntrabarOrderGeneration=True, when I run this code live with autotrading in real time, I see "Delta Check Fail Short" flicker on and off lots of times during that bar. For context price was right at my conditional for entry, and CumulativeDeltaCheckShort was bouncing from true to false based on cumulative delta bouncing back and forth in and out of my entry requirements.
My question is: Shouldn't this only happen once? The first time it failed it sets CumulativeDeltaCheckShortFailure=True and should never run again that day, or what don't I understand?
Code: Select all
IF [all my conditionals for trade] AND (CumulativeDeltaCheckShortFailure=False) AND FirstTrade then begin
IF CumulativeDeltaCheckShort then begin
FirstTrade=False;
SellShort("FadeIBH") MyQty contracts next bar market;
end
else begin
CumulativeDeltaCheckShortFailure=True;
PlotText=Text_new(Date,Time,(IBH-((IBH-IBL)/2)),"Delta Check Fail Short");
Text_SetSize(PlotText, 7);
//Give chance to reset itself maybe later, but fail for now so we don't mistakenly enter at odd place
end;
end;
Code: Select all
IF Date>Date[1] then begin
CumulativeDeltaCheckShortFailure=False;
//Other Stuff Also
end;
Thanks all.
Daniel