The alert condition check in the settings is set to Every Tick.
I noticed on some charts it's fine, while on others it fires one bar late. I can't see anything different in the settings, so I'm wondering if it's related to the PrevMP and the IntraBarPersist setting? How do I clear that fully?
Alert Signal:
Code: Select all
Inputs: WorkspaceName("TestWorkspace");
Variables:
IntraBarPersist PrevMP(0),
MP(0), msgText(""), netdiff(0);
MP = MarketPosition(0) * CurrentContracts;
msgText = "MC - Strategy Filled Order: ";
if(MP <> PrevMP) then
begin
netdiff = MP - PrevMP;
if netdiff <> 0 then
Alert(msgText + NumToStr(netdiff,0) + NEWLINE + "Workspace: \" + WorkspaceName);
end;
PrevMP = MP;