비틀어 비틀어 iMA 속이고 싶어 - 페이지 9

 
imtochukwu :

블라디미르는 그것을 알아 내고 그것을 시작했습니다. 여기에서 구매 주문과 함께 판매 주문을 어디에서 변경할 수 있습니까?

각 신호 모듈에는 매수 또는 매도 신호가 발생하는 두 가지 기능이 있습니다. "LongCondition" 및 "ShortCondition"입니다.
 
Vladimir Karputov :

각 신호 모듈에는 매수 또는 매도 신호가 발생하는 두 가지 기능이 있습니다. "LongCondition" 및 "ShortCondition"입니다.


내가 이해하는 바에 따르면 귀하의 Expert Advisor는 다음과 같습니다.

int CSignalMA::LongCondition( void )
  {
   int result= 0 ;
   int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (m_reverse)
       if (DiffCloseMA(idx)> 0.0 )
        {
         //--- the close price is above the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
   if (!m_reverse)
       if (DiffCloseMA(idx)< 0.0 )
        {
         //--- the close price is below the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
//--- return the result
   return (result);
  }
//+------------------------------------------------------------------+
//| "Voting" that price will fall.                                   |
//+------------------------------------------------------------------+
int CSignalMA::ShortCondition( void )
  {
   int result= 0 ;
   int idx   =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (m_reverse)
       if (DiffCloseMA(idx)< 0.0 )
        {
         //--- the close price is below the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
   if (!m_reverse)
       if (DiffCloseMA(idx)> 0.0 )
        {
         //--- the close price is above the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
//--- return the result
   return (result);
  }
//+------------------------------------------------------------------+‌

작업을 담당하는 라인은 어디에 있습니까? 이 속성을 변경하는 방법은 무엇입니까?

 
imtochukwu :


내가 이해하는 바에 따르면 귀하의 Expert Advisor는 다음과 같습니다.

int CSignalMA::LongCondition( void )
  {
   int result= 0 ;
   int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (m_reverse)
       if (DiffCloseMA(idx)> 0.0 )
        {
         //--- the close price is above the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
   if (!m_reverse)
       if (DiffCloseMA(idx)< 0.0 )
        {
         //--- the close price is below the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
//--- return the result
   return (result);
  }
//+------------------------------------------------------------------+
//| "Voting" that price will fall.                                   |
//+------------------------------------------------------------------+
int CSignalMA::ShortCondition( void )
  {
   int result= 0 ;
   int idx   =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (m_reverse)
       if (DiffCloseMA(idx)< 0.0 )
        {
         //--- the close price is below the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
   if (!m_reverse)
       if (DiffCloseMA(idx)> 0.0 )
        {
         //--- the close price is above the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
//--- return the result
   return (result);
  }
//+------------------------------------------------------------------+‌

작업을 담당하는 라인은 어디에 있습니까? 이 속성을 변경하는 방법은 무엇입니까?

‌코드를 올바르게 삽입하십시오: 포럼에 코드를 올바르게 삽입하십시오

전문가가 아니라 신호 모듈에서 코드를 가져왔습니다.

"Reverse" 설정이 있기 때문에 신호의 방향을 변경하기 위해 내 모듈에서 변경할 필요가 없습니다. 값(true 또는 false)에 따라 신호가 반대 방향으로 직접 변경될 수 있습니다.

‌"LongCondition"의 예:

‌반대("m_reverse")가 true 이고 종가에서 지표 값을 뺀 값이 0보다 크면 "Long"(매수) 신호를 발행합니다.

int CSignalMA::LongCondition( void )
  {
   int result= 0 ;
   int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (m_reverse)
       if (DiffCloseMA(idx)> 0.0 )
        {
         //--- the close price is above the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
   if (!m_reverse)
       if (DiffCloseMA(idx)< 0.0 )
        {
         //--- the close price is below the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
//--- return the result
   return (result);
  }
 
Vladimir Karputov :

‌코드를 올바르게 삽입하십시오: 포럼에 코드를 올바르게 삽입하십시오

전문가가 아니라 신호 모듈에서 코드를 가져왔습니다.

"Reverse" 설정이 있기 때문에 신호의 방향을 변경하기 위해 내 모듈에서 변경할 필요가 없습니다. 값(true 또는 false)에 따라 신호가 반대 방향으로 직접 변경될 수 있습니다.

‌"LongCondition"의 예:

‌반대("m_reverse")가 true 이고 종가에서 지표 값을 뺀 값이 0보다 크면 "Long"(매수) 신호를 발행합니다.

int CSignalMA::LongCondition( void )
  {
   int result= 0 ;
   int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (m_reverse)
       if (DiffCloseMA(idx)> 0.0 )
        {
         //--- the close price is above the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
   if (!m_reverse)
       if (DiffCloseMA(idx)< 0.0 )
        {
         //--- the close price is below the indicator (the indicator has no objections to buying)
         if (IS_PATTERN_USAGE( 0 ))
            result=m_pattern_0;
        }
//--- return the result
   return (result);
  }

블라디미르, 새로운 문제가 나타났습니다. Expert Advisor가 편집되었지만 차트로 끌어서 설정에 동의하려고 하면. 잠시 동안 오른쪽 모서리에 어드바이저가 실행중인 아이콘이 있습니다. 그러면 즉시 사라집니다. 이유는 무엇입니까? 이 반전은 대단한 것입니다. 다른 Expert Advisor에 어떻게 적용할 수 있나요?
 
imtochukwu :

블라디미르, 새로운 문제가 나타났습니다. Expert Advisor가 편집되었지만 차트로 끌어서 설정에 동의하려고 하면. 잠시 동안 오른쪽 모서리에 어드바이저가 실행중인 아이콘이 있습니다. 그러면 즉시 사라집니다. 이유는 무엇입니까? 이 반전은 대단한 것입니다. 다른 Expert Advisor에 어떻게 적용할 수 있나요?

"전문가" 및 "로그" 탭의 터미널 창 "도구"에서 오류 메시지 를 찾으십시오...
 

내가 알기로는 SignalMA.mqh 파일에서 "가격이 상승" 하는 경우 포지션을 여는 역할을 하는 섹션이 있습니까?

//+------------------------------------------------------------------+
//| "Voting" that price will grow.                                   |
//+------------------------------------------------------------------+
int CSignalMA::LongCondition( void )
  {
   int result= 0 ;
   int idx   =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (DiffCloseMA(idx)< 0.0 )
     {
       //--- the close price is below the indicator
       if (IS_PATTERN_USAGE( 1 ) && DiffOpenMA(idx)> 0.0 && DiffMA(idx)> 0.0 )
        {
         //--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
         result=m_pattern_1;
         //--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
         m_base_price= 0.0 ;
        }
     }
   else
     {
       //--- the close price is above the indicator (the indicator has no objections to buying)
       if (IS_PATTERN_USAGE( 0 ))
         result=m_pattern_0;
       //--- if the indicator is directed upwards
       if (DiffMA(idx)> 0.0 )
        {
         if (DiffOpenMA(idx)< 0.0 )
           {
             //--- if the model 2 is used
             if (IS_PATTERN_USAGE( 2 ))
              {
               //--- the open price is below the indicator (i.e. there was an intersection)
               result=m_pattern_2;
               //--- suggest to enter the market at the "roll back"
               m_base_price=m_symbol.NormalizePrice(MA(idx));
              }
           }
         else
           {
             //--- if the model 3 is used and the open price is above the indicator
             if (IS_PATTERN_USAGE( 3 ) && DiffLowMA(idx)< 0.0 )
              {
               //--- the low price is below the indicator
               result=m_pattern_3;
               //--- consider that this is a formed "piercing" and suggest to enter the market at the current price
               m_base_price= 0.0 ;
              }
           }
        }
     }
//--- return the result
   return (result);
  }


‌이를 모듈의 코드로 바꾸면 올바르게 작동합니까? 사실은 내용이 귀하와 약간 다릅니다. 더 많은 코드는 여기에 .. 흠

 
imtochukwu :

내가 알기로는 SignalMA.mqh 파일에서 "가격이 상승" 하는 경우 포지션을 여는 역할을 하는 섹션이 있습니까?

//+------------------------------------------------------------------+
//| "Voting" that price will grow.                                   |
//+------------------------------------------------------------------+
int CSignalMA::LongCondition( void )
  {
   int result= 0 ;
   int idx   =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if (DiffCloseMA(idx)< 0.0 )
     {
       //--- the close price is below the indicator
       if (IS_PATTERN_USAGE( 1 ) && DiffOpenMA(idx)> 0.0 && DiffMA(idx)> 0.0 )
        {
         //--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
         result=m_pattern_1;
         //--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
         m_base_price= 0.0 ;
        }
     }
   else
     {
       //--- the close price is above the indicator (the indicator has no objections to buying)
       if (IS_PATTERN_USAGE( 0 ))
         result=m_pattern_0;
       //--- if the indicator is directed upwards
       if (DiffMA(idx)> 0.0 )
        {
         if (DiffOpenMA(idx)< 0.0 )
           {
             //--- if the model 2 is used
             if (IS_PATTERN_USAGE( 2 ))
              {
               //--- the open price is below the indicator (i.e. there was an intersection)
               result=m_pattern_2;
               //--- suggest to enter the market at the "roll back"
               m_base_price=m_symbol.NormalizePrice(MA(idx));
              }
           }
         else
           {
             //--- if the model 3 is used and the open price is above the indicator
             if (IS_PATTERN_USAGE( 3 ) && DiffLowMA(idx)< 0.0 )
              {
               //--- the low price is below the indicator
               result=m_pattern_3;
               //--- consider that this is a formed "piercing" and suggest to enter the market at the current price
               m_base_price= 0.0 ;
              }
           }
        }
     }
//--- return the result
   return (result);
  }


‌이를 모듈의 코드로 바꾸면 올바르게 작동합니까? 사실은 내용이 귀하와 약간 다릅니다. 더 많은 코드는 여기에 .. 흠


내 코드를 가져 와서 여기에 붙여넣으면 작동하지 않습니다.
 
Vladimir Karputov :

내 코드를 가져 와서 여기에 붙여넣으면 작동하지 않습니다.

블라디미르 카르푸토프 :

내 코드를 가져 와서 여기에 붙여넣으면 작동하지 않습니다.


블라디미르, 모든 것이 작동하려면 역순을 어디에 삽입해야합니까?

파일 사본을 만들고 포함 이름을 변경해야한다는 것이 분명합니다.

 

표준 신호 모듈의 신호를 반대로 하려면:

  • 다른 이름으로 파일 사본 만들기
  • 모듈 설명 변경

// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=***          |
//| Type=SignalAdvanced                                              |
//| Name=Moving Average                                              |

  • 그냥 함수 이름 바꾸기: LongCondition <--> ShortCondition

 
Vladimir Karputov :

표준 신호 모듈의 신호를 반대로 하려면:

  • 다른 이름으로 파일 사본 만들기
  • 모듈 설명 변경

// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=***          |
//| Type=SignalAdvanced                                              |
//| Name=Moving Average                                              |

  • 그냥 함수 이름 바꾸기: LongCondition <--> ShortCondition


블라디미르, 감사합니다. 많은 도움이 되었습니다. 이제 문제는 고문이 내리는 이익 실현 및 손절매 주문을 만드는 방법으로 남아 있습니다. 그것들을 어떻게 제한합니까?