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

Steve Cartwright Trader Camel CCI MACD - MetaTrader 5용 expert

게시자:
Vladimir Karputov
조회수:
5498
평가:
(27)
게시됨:
2017.03.22 16:33
업데이트됨:
2018.02.27 12:31
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Author of the idea — John Smithauthor of the MQL5 code — barabashkakvn

The Expert Advisor is configured to trade USDJPY on the H1 timeframe.

The EA uses two Moving Averages, one MACD and one CCI. OnTradeTransaction is used to receive position opening time.

All indicator values are used from the bar with index 1.

//--- Indicator Setup 
   CAMELHIGHP1=iMAGet(handle_iMA_PRICE_HIGH,1);
   CAMELLOWP1=iMAGet(handle_iMA_PRICE_LOW,1);
//
   MACDSP1=iMACDGet(SIGNAL_LINE,1);
   MACDSP2=iMACDGet(SIGNAL_LINE,2);
//
   MACDHP1=iMACDGet(MAIN_LINE,1);
   MACDHP2=iMACDGet(MAIN_LINE,2);
//
   CCIP1=iCCIGet(1);

The appropriate control is performed: whether a position has already been opened on the current bar, so there is no need to check all positions (because other Expert Advisors can be running on the same trading account).

Position opening time is controlled in OnTradeTransaction. If position closure was recorded, the open time will be reset:

//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction &trans,
                        const MqlTradeRequest &request,
                        const MqlTradeResult &result)
  {
//--- get transaction type as enumeration value 
   ENUM_TRADE_TRANSACTION_TYPE type=trans.type;
//--- if transaction is result of addition of the transaction in history
   if(type==TRADE_TRANSACTION_DEAL_ADD)
     {
      long     deal_entry        =0;
      long     deal_time         =0;
      string   deal_symbol       ="";
      long     deal_magic        =0;
      if(HistoryDealSelect(trans.deal))
        {
         deal_entry=HistoryDealGetInteger(trans.deal,DEAL_ENTRY);
         deal_time=HistoryDealGetInteger(trans.deal,DEAL_TIME);
         deal_symbol=HistoryDealGetString(trans.deal,DEAL_SYMBOL);
         deal_magic=HistoryDealGetInteger(trans.deal,DEAL_MAGIC);
        }
      else
         return;
      if(deal_symbol==m_symbol.Name() && deal_magic==m_magic)
        {
         if(deal_entry==DEAL_ENTRY_OUT)
           {
            m_last_close_time=(datetime)deal_time;
           }
         else if(deal_entry!=DEAL_ENTRY_OUT)
           {
            m_last_close_time=0;
           }
        }
     }
  }

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/17841

ColorXWPR_Histogram_HTF ColorXWPR_Histogram_HTF

The ColorXWPR_Histogram indicator with the timeframe selection option available in the input parameters.

VTS_Keltner VTS_Keltner

A trend indicator VTS using the Keltner channel.

ColorKeltnerCandles ColorKeltnerCandles

This indicator colors candlesticks in different colors depending on the strength and direction of the trend, using Keltner channels

SSL_HTF SSL_HTF

The SSL indicator with the timeframe selection option available in input parameters