I tried to use "currentcontracts" to detect open position change (currentcontracts change) in my IOG code but failed. The reason is, in IOG code, even you assign currentcontracts to some variable, say, CC, the assigned variable will not change until a new bar prints on chart...is there any way to be able to detect the change instantaneously without waiting for a bar to close?
Code: Select all
[IntrabarOrderGeneration = TRUE]
vars:
CC(0);
.....
CC=currentcontracts;
......
//if currentcontracts has changed
if CC<>CC[1] then begin
.......................
end;
thanks,
-kernel