Trailing Stop with Commission

Back to topics list To post a new topic, please log in or register
avatar
3
roi_ 2016.02.04 09:54
 

Hi,

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,

 

thanks

Roi 

 

avatar
Moderator
3405
GumRai 2016.02.04 11:24 #
 
Don't start the trailing stop until it is x pips in profit the x being the amount of pips for the TS plus an allowance in pips that will cover the commission.
avatar
3
roi_ 2016.02.04 12:05 #
 

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?

avatar
Moderator
3405
GumRai 2016.02.04 12:57 #
 
roi_:

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) 

avatar
3
roi_ 2016.02.04 13:32 #
 

OrderClosePrice() can't be because it still running, you mean Bid?

 

avatar
Moderator
3405
GumRai 2016.02.04 13:39 #
 

OrderClosePrice()  is the most recent price for the order, for a Buy, it will be Bid, for a Sell, Ask.

Same as Close[0], The 0 bar has not closed yet, but Close[0] holds the most recent price. 

Back to topics list  

To add comments, please log in or register