거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
스크립트

BreakEven Function - MetaTrader 4용 스크립트

조회수:
6315
평가:
(26)
게시됨:
2022.03.06 08:03
Function.mq4 (3.07 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
//+------------------------------------------------------------------+
//|Breakeven                                                         |
//+------------------------------------------------------------------+
void BreakEven(double _breakEvenPips, bool useSymbol=false, bool useMagicNumber=false, int _magicNumber=0) {
    for(int i=OrdersTotal()-1; i>=0; i--) {
        if(OrderSelect(i,SELECT_BY_POS)) {
            bool magic = (useMagicNumber) ? (OrderMagicNumber()==_magicNumber) : true;
            bool symbol = (useSymbol) ? (OrderSymbol()==Symbol()) : true;
            if(!magic || !symbol) continue;
            if(OrderType() == OP_BUY) {
                if(NormalizeDouble(OrderStopLoss(),_Digits) < NormalizeDouble(OrderOpenPrice(),_Digits)) {
                    if(Bid - OrderOpenPrice() >= NormalizeDouble(_breakEvenPips * Point() * 10,_Digits)) {
                        if(NormalizeDouble(OrderStopLoss(),_Digits) != NormalizeDouble(OrderOpenPrice(),Digits)){
                            ResetLastError();
                            if(!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderOpenPrice(),_Digits), OrderTakeProfit(), 0)) {
                               Print("ERROR:"," Order Modify Failed: ",_LastError,"  ||  Function Name: ",__FUNCTION__,"  ||  Line Number: ",__LINE__);
                            }
                        }
                    }
                }
            }
            
            if(OrderType() == OP_SELL) {
                if(NormalizeDouble(OrderStopLoss(),_Digits) > NormalizeDouble(OrderOpenPrice(),_Digits)) {
                    if(OrderOpenPrice() - Bid >= NormalizeDouble(_breakEvenPips * Point() * 10,_Digits)) {
                        if(NormalizeDouble(OrderStopLoss(),_Digits) != NormalizeDouble(OrderOpenPrice(),_Digits)) {
                            ResetLastError();
                            if(!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderOpenPrice(),_Digits), OrderTakeProfit(), 0)) {
                                Print("ERROR:"," Order Modify Failed: ",_LastError,"  ||  Function Name: ",__FUNCTION__,"  ||  Line Number: ",__LINE__);
                            }
                        }
                    }
                }
            }
        }
    }
}
    GARCHV2 GARCHV2

    A second version of GARCH volatility indicator of https://www.mql5.com/en/code/11776.

    Multi Currencies EA CloseAll Multi Currencies EA CloseAll

    Due to recent popularity of Multi currencies EA, This codes allows to Close Orders or delete Pending orders of a Multi Currencies EA, Single Currency EA or Manual orders.

    Adaptive momentum oscillator idea from David Varadi. Adaptive momentum oscillator idea from David Varadi.

    Adaptive momentum oscillator idea from David Varadi.

    MA Angle MA Angle

    Not sure if anyone need this. Just showing the angle of the MA of current and adjacent candle.