I m wondering how to code "exitlong" or "exitshort" conditions.
Below, you can see my extrait of my code (which doesn't work...)
Code: Select all
// exitlong conditions
If (Marketposition = 1) then begin
Sell currentbar at entryprice+5 ;
end;
setstoploss (-5);
order n°2 => it would be placed to "myentryprice + 5 ticks" (with limit order and on the current bar)
and
order n°3 => it would be placed to "myentryprice - 5 ticks" (with market order, a kind of stoploss...)
and "if current price = myentryprice + 2 ticks" then the order n°3 is going up to this level.
Anybody have an idea please?