Je re?ois un b?n?fice n?gatif lors de l'ex?cution de la perte de fin de suivi parce que le code ne tient pas compte de la commission et de l'?change,
J'ai essay? les suivants qui ne fonctionnent pas
besoin d'aide, merci!
void LongTrailingStop ()
{
int lcnt;
int ltotal = OrdersTotal ();
double BuyProfit;
pour (lcnt = ltotal-1; lntnt gt; = 0; lcnt--)
{
OrderSelect (lcnt, SELECT_BY_POS, MODE_TRADES);
if (OrderType () lt; = OP_SELL OrderSymbol () == Symbole ())
{
if (OrderType () == OP_BUY)/position longue ouverte
{
if (TrailingStopgt; 0)
{
if (Bid-OrderOpenPrice () gt; (Point * TrailingStop))
{
if (OrderStopLoss () lt; Bid- (Point * TrailingStop))
{
BuyProfit = (OrderProfit () OrderCommission () OrderSwap ());
OrderModify (OrderTicket (), OrderOpenPrice (), Bid- (Point * TrailingStop BuyProfit), OrderTakeProfit (), 0, Vert);
retour (0);
}
}
}
}
}
}
}