I have a problem,
my broker use commissions, when I use in my EA trail stop it close the trade without profit finaly because it from Open price to close price standpoint its ok but than
the commission is not included and the net trade is loss.
how can I tell the EA only if net pips is more than X pips start trail,
so you mean, I'll check (for BUY order for example) if OrderProfit() > = 0 and (OrderOpenPrice - TrailStop) > Bid
than if yes , I'll start trail?
No, for a buy
if(OrderClosePrice()-OrderOpenPrice()>=TrailStop+allowance for commisison)
OrderClosePrice() can't be because it still running, you mean Bid?
OrderClosePrice() is the most recent price for the order, for a Buy, it will be Bid, for a Sell, Ask.
Same as Close, The 0 bar has not closed yet, but Close holds the most recent price.
To add comments, please log in or register