Bükürüm, bükerim, iMA'yı aldatmak istiyorum - sayfa 9

 
imtochukwu :

Vladimir, anladı, başlattı. Ve burada alış emirleri ile satış emirlerini nerede değiştirebilirim?

Her sinyal modülünün, alım veya satım sinyallerinin verilmesinin gerçekleştiği iki işlevi vardır. Bunlar "LongCondition" ve "ShortCondition"dır.
 
Vladimir Karputov :

Her sinyal modülünün, alım veya satım sinyallerinin verilmesinin gerçekleştiği iki işlevi vardır. Bunlar "LongCondition" ve "ShortCondition"dır.


Anladığım kadarıyla, Uzman Danışmanınızda:

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);
  }
//+------------------------------------------------------------------+‌

eylemden sorumlu olan hat nerede? Ve bu özellik nasıl değiştirilir?

 
imtochukwu :


Anladığım kadarıyla, Uzman Danışmanınızda:

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);
  }
//+------------------------------------------------------------------+‌

eylemden sorumlu olan hat nerede? Ve bu özellik nasıl değiştirilir?

‌Lütfen kodu doğru giriniz: Kodu foruma doğru şekilde giriniz

Kodu UZMANDAN DEĞİL, SİNYALLER MODÜLÜ'nden getirdiniz.

Modülümde sinyalin yönünü değiştirmek için hiçbir şeyin değiştirilmesi gerekmez, çünkü "Ters" ayarına sahiptir - sahip olduğu değere (doğru veya yanlış) bağlı olarak, sinyaller doğrudan zıt olanlara değişebilir.

‌"LongCondition" örneğinde:

‌Ters ("m_reverse") doğruysa ve kapanış fiyatı eksi gösterge değeri sıfırdan büyükse , o zaman bir "Uzun" sinyali veririz (Satın Al)

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 :

‌Lütfen kodu doğru giriniz: Kodu foruma doğru şekilde giriniz

Kodu UZMANDAN DEĞİL, SİNYALLER MODÜLÜ'nden getirdiniz.

Modülümde sinyalin yönünü değiştirmek için hiçbir şeyin değiştirilmesi gerekmez, çünkü "Ters" ayarına sahiptir - sahip olduğu değere (doğru veya yanlış) bağlı olarak, sinyaller doğrudan zıt olanlara değişebilir.

‌"LongCondition" örneğinde:

‌Ters ("m_reverse") doğruysa ve kapanış fiyatı eksi gösterge değeri sıfırdan büyükse , o zaman bir "Uzun" sinyali veririz (Satın Al)

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, yeni bir sorun ortaya çıktı. Expert Advisor'ınız derlenmiş fakat grafiğe sürüklemeye çalıştığımda ayarlara katılıyorum. Sağ köşede bir süredir danışmanın çalıştığı bir simge var. Sonra hemen kaybolur. Nedeni ne olabilir? Bu geri dönüş harika bir şey. Diğer Uzman Danışmanlarda nasıl uygulanabilir??
 
imtochukwu :

Vladimir, yeni bir sorun ortaya çıktı. Expert Advisor'ınız derlenmiş fakat grafiğe sürüklemeye çalıştığımda ayarlara katılıyorum. Sağ köşede bir süredir danışmanın çalıştığı bir simge var. Sonra hemen kaybolur. Nedeni ne olabilir? Bu geri dönüş harika bir şey. Diğer Uzman Danışmanlarda nasıl uygulanabilir??

"Uzmanlar" ve "Günlük" sekmelerindeki "Araçlar" terminal penceresindeki hata mesajlarını arayın...
 

Anladığım kadarıyla SignalMA.mqh dosyasında "fiyat yükselirse" pozisyon açmaktan sorumlu olan bölüm burası mı?

//+------------------------------------------------------------------+
//| "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);
  }


‌Bunu modülünüzdeki kodla değiştirirseniz, düzgün çalışır mı? Gerçek şu ki, içerik sizinkinden biraz farklı. Burada daha fazla kod var.. hmm

 
imtochukwu :

Anladığım kadarıyla SignalMA.mqh dosyasında "fiyat yükselirse" pozisyon açmaktan sorumlu olan bölüm burası mı?

//+------------------------------------------------------------------+
//| "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);
  }


‌Bunu modülünüzdeki kodla değiştirirseniz, düzgün çalışır mı? Gerçek şu ki, içerik sizinkinden biraz farklı. Burada daha fazla kod var.. hmm


Kodumu alıp buraya yapıştırırsanız çalışmaz.
 
Vladimir Karputov :

Kodumu alıp buraya yapıştırırsanız çalışmaz.

Vladimir Karputov :

Kodumu alıp buraya yapıştırırsanız çalışmaz.


Vladimir, her şeyin çalışması için tersini nereye eklemeniz gerekiyor?

Dosyanın bir kopyasını oluşturmanız, içerdiği adını değiştirmeniz gerekeceği açıktır.

 

Standart sinyal modülündeki sinyalleri tersine çevirmek isterseniz:

  • farklı bir adla dosyanın bir kopyasını oluşturun
  • modül açıklamasını değiştir

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

  • sadece işlev adlarını değiştirin: LongCondition <--> ShortCondition

 
Vladimir Karputov :

Standart sinyal modülündeki sinyalleri tersine çevirmek isterseniz:

  • farklı bir adla dosyanın bir kopyasını oluşturun
  • modül açıklamasını değiştir

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

  • sadece işlev adlarını değiştirin: LongCondition <--> ShortCondition


Vladimir, teşekkür ederim, çok yardımcı oldun. Şimdi soru, danışmanın verdiği kar alma ve zararı durdurma emirlerinin nasıl yapılacağıdır. Onları nasıl sınırlı hale getirebiliriz?
Neden: