I have the problem with the code below:
Code: Select all
var:
MP(0),
N(0),
CloseHalfPosition (0),
P(0);
P = Entryprice(0);
CloseHalfPosition = P + 50 point;
N = MarketPosition_at_Broker;
If N > 0 and P <> 0.0 and P > CloseHalfPosition
Then Begin
Once
print(
" P: ", P:3:5,
" N: ", N,
" N/2: ", N/2,
" close N/2: ", P + 50 point:3:5
);
Sell CloseHalfPosition contract this bar at market;
End;
Thanks,
tradingest