Ich bin wieder testen mit MB-Demo-Demo. Der Standard-Trailing-Stop-Code berücksichtigt nicht den Kommissions- und Order-Swap.
Hat jemand versucht, den Trailing Stop nicht mit negativen Gewinnen zu verlieren?
typischer Trailing Stop Code:
void ShortTrailingStop ()
{
int scnt;
int stotal = BestellungenTotal ();
für (scnt = stotal-1; scnt gt; = 0; scnt--)
{
OrderSelect (scnt, SELECT_BY_POS, MODE_TRADES);
if (OrderType () lt; = OP_SELL OrderSymbol () == Symbol ())
{
if (OrderType () == OP_SELL)/Kurze Position wird geöffnet
{
if (TrailingStopgt; 0)
{
if ((OrderOpenPrice () - Ask) gt; (Punkt * TrailingStop))
{
if ((OrderStopLoss () gt; (Fragen (Point * TrailingStop))) || (OrderStopLoss () == 0))
{
OrderModify (OrderTicket (), OrderOpenPrice (), Ask (Punkt * TrailingStop), OrderTakeProfit (), 0, Rot);
Rückkehr (0);
}
}
}
}
}
}
}