Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 20.09.11
Benutzerbild von jwah
jwah jwah ist offline
Neues Mitglied
 
Registriert seit: Sep 2011
Ort: Berlin
Beiträge: 5
jwah befindet sich auf einem aufstrebenden Ast
Standard mein BreakEven macht nicht das was ich will

so.... 2ter versuch
ich brauche einfach nur einen BreakEven, der einmal ordermodify macht.

z.z. macht er immer noch trailing, das heisst, er macht alle breakevenpoint eine neue ordermodify

auf der shortseite macht er garnichts...???

keine Ahnung warum

hier der code

Code:
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
    if (OrderSymbol() == Symbol() && OrderMagicNumber() == ~OrderId~)
    {
        if (OrderType() == OP_BUY && Ask - OrderOpenPrice() > ~BreakEvenPoint~*PipValue*Point && (OrderStopLoss() < Ask-(~BreakEvenPoint~+~TrailingGap~)*PipValue*Point))
        {
            bool ret1 = OrderModify(OrderTicket(), OrderOpenPrice(), Ask-~TrailingGap~*PipValue*Point, OrderTakeProfit(), OrderExpiration(), ~Color~);
            if (ret1 == false)
                Print("OrderModify() error - ", ErrorDescription(GetLastError()));
        }
        if (OrderType() == OP_SELL && OrderOpenPrice() - Bid > ~BreakEvenPoint~*PipValue*Point && (OrderStopLoss() > Bid+(~BreakEvenPoint~+~TrailingGap~)*PipValue*Point))
        {
            bool ret2 = OrderModify(OrderTicket(), OrderOpenPrice(), Bid+~TrailingGap~*PipValue*Point, OrderTakeProfit(), OrderExpiration(), ~Color~);
            if (ret2 == false)
                Print("OrderModify() error - ", ErrorDescription(GetLastError()));
        }
    }
}
else
    Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
~next~