Help getting position volume
Okay I know I can use PositionGetDouble(POSITION_VOLUME) to get the current order's position, and that works fine, but when I close the order it still returns the volume of the last position? Shouldn't it return 0?
Hi, thanks for the reply. I have the command in the OnTick function of an EA and it still gives me the last volume of the position well after it's closed every tick.
I have something like
int OnInit() { PositionSelect(_Symbol); } int OnTick() { Print(PositionGetDouble(POSITION_VOLUME)); }
The output I get is something like (time goes from bottom to top):
......end
0.1
0.1
0.1
0.1 <-----close position
0.1
0.1
0.1
0.1 <----buy here
0
0
0
start.....
Shouldn't it return zero after I closed the position?
Okay I know I can use PositionGetDouble(POSITION_VOLUME) to get the current order's position, and that works fine, but when I close the order it still returns the volume of the last position? Shouldn't it return 0?