Allows you to set a protective stop at the entry price of the current position (SET STOP)
or a protective target in case of a position in loss (SET TARGET)
SET STOP BREAKEVEN (case of a position in profit)
It works the same way as setting a stoploss on an order with SET STOP. If the stoploss is placed on the breakeven with the instruction, then it will remain so until it is modified or moved with the SET STOP instruction.
syntax:
1 |
Set Stop Breakeven |
example:
Put stoploss to breakeven, once price has reached 10 points of profit (case of long order)
1 2 3 4 5 |
if longonmarket then if high-tradeprice >= 10*pointsize then set stop breakeven endif endif |
SET TARGET BREAKEVEN (case of a position in loss)
It works the same way as setting a target profit on an order with SET TARGET. If the takeprofit is placed on the breakeven with the instruction, then it will remain so until it is modified or moved with the SET TARGET instruction.
syntax:
1 |
Set Target Breakeven |
example:
Put takeprofit to breakeven, if price is in loss of 10 points (case of long order)
1 2 3 4 5 |
if longonmarket then if tradeprice-low >= 10*pointsize then set target breakeven endif endif |