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

SignalCandelsHighOpen - MetaTrader 5용 라이브러리

조회수:
4097
평가:
(16)
게시됨:
2017.01.19 17:03
업데이트됨:
2017.09.06 09:38
\MQL5\Include\Expert\MySig\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The entire chain: Candels High Open indicator, Expert Advisor based on the CandelsHighOpen signal module. 

The SignalCandelsHighOpen module of trading signals assumes that the Candels High Open custom indicator has already been compiled and placed to \MQL5\Indicators\. This path is specified in the module of the next code block:

//+------------------------------------------------------------------+
//| Create the "Candels High Open" indicator                         |
//+------------------------------------------------------------------+
bool CSignalCHO::CreateCandelsHighOpen(CIndicators *indicators)
  {
//--- pointer check
   if(indicators==NULL) return(false);
//--- add the object to the collection
   if(!indicators.Add(GetPointer(m_SignalCHO)))
     {
      printf(__FUNCTION__+": failed to add CandelsHighOpen object");
      return(false);
     }
//--- set Candels High Open indicator parameters
   MqlParam parameters[2];
//---
   parameters[0].type=TYPE_STRING;
   parameters[0].string_value="Candels High Open.ex5";
   parameters[1].type=TYPE_INT;
   parameters[1].integer_value=m_reverse_signals;  // reverse
//--- object initialization  
   if(!m_SignalCHO.Create(m_symbol.Name(),m_period,IND_CUSTOM,2,parameters))
     {
      printf(__FUNCTION__+": failed to initialize CandelsHighOpen object");
      return(false);
     }
//--- number of buffers
   if(!m_SignalCHO.NumBuffers(1)) return(false);
//--- reaching this string means the function is executed successfully - return 'true'
   return(true);
  }

If the indicator is placed to another folder, like \MQL5\Indicators\Examples\, the path to the indicator is as follows:

   parameters[0].string_value="Examples\\Candels High Open.ex5";

Buy and sell signals:

Since the Candels High Open indicator contains only three values in its buffer:

  • "+1" - buy signal
  • "0" - no signal
  • and "-1" - sell signal
The trading signals module does the same:

//+------------------------------------------------------------------+
//| Return the buy signal power                                      |
//+------------------------------------------------------------------+
int CSignalCHO::LongCondition()
  {
   int signal=0;
//--- for working by ticks idx=0, for working by complete bars idx=1
   int idx=StartIndex();
//--- signal values on the last complete bar
   double ind_value=Signal(idx);
//---
   if(ind_value>0.0)
     {
      signal=100; // a buy signal is present
     }

//--- return the signal value
   return(signal);
  }
//+------------------------------------------------------------------+
//| Return a sell signal power                                       |
//+------------------------------------------------------------------+
int CSignalCHO::ShortCondition()
  {
   int signal=0;
//--- for working by ticks idx=0, for working by complete bars idx=1
   int idx=StartIndex();
//--- signal values on the last complete bar
   double ind_value=Signal(idx);
//---
   if(ind_value<0.0)
     {
      signal=100; // a sell signal is present
     }

//--- return the signal value
   return(signal);
  }

When generating an EA via the MQL5 Wizard, search for the signal module with the "Analyzing High and Open of the last three bars" description:

SignalCandelsHighOpen

 

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

Candels High Open Candels High Open

Candels High Open indicator analyzes High and Open of the last three bars.

Zigzag2_R_Color_Arrows_HTF Zigzag2_R_Color_Arrows_HTF

The Zigzag2_R_Color indicator with the timeframe selection option in the input parameters and display of values as fractal labels.

CandelsHighOpen CandelsHighOpen

CandelsHighOpen Expert Advisor is based on the Candels High Open indicator trading signals module. The EA features trading market and pending orders, as well as trailing stop based on Parabolic SAR.

Original Turtle Rules Trader Original Turtle Rules Trader

Original Turtle Rule Trader Expert Advisor implements a trading system described in the book "The Original Turtle Trading Rules". The EA code implements the visual display of the three Donchian channels, money management, opening and adding trades and moving stop levels.