Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   mein BreakEven macht nicht das was ich will (http://www.expert-advisor.com/forum/showthread.php?t=1603)

jwah 20.09.11 18:32

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~


JoeDormann 20.09.11 18:41

Hallo
Keine Ahnung was da generiert wird.
Mußt den Anbieter fragen.
Gruß Joe


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:43 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum