Bir danışmanı rastgele nasıl bir araya getiririm? - sayfa 47

[Silindi]  

Yine de kodda bir fark var, Göstergeden farklı sinyaller alınıyor.

eğer öyleyse, daha az gösterge uygundur

 //---
   double BuyBuffer[];
   double SellBuffer[];
   ArraySetAsSeries (BuyBuffer, true );
   ArraySetAsSeries (SellBuffer, true );
   if (!iGetArray(handle_iCustom, 1 , 0 , 2 ,BuyBuffer) || !iGetArray(handle_iCustom, 0 , 0 , 2 ,SellBuffer))
     {
      ExtPrevBarsY= 0 ;
       return ( false );
     }
//---
   if (BuyBuffer[ 1 ]!= 0.0 )
     {

Ve böyle, daha iyi çalışıyor

 //---
   double main[],signal[];
   ArraySetAsSeries (main, true );
   ArraySetAsSeries (signal, true );
   int start_pos= 0 ,count= 3 ;
   if (!iGetArray(handle_iCustom, MAIN_LINE ,start_pos,count,main) ||
      !iGetArray(handle_iCustom, SIGNAL_LINE ,start_pos,count,signal))
     {
      ExtPrevBarsY= 0 ;
       return ( false );
     }

   if (main[ 1 ]>signal[ 1 ])
     {

Bunu beğenmek için değişti! Hala performans için uzmanı kontrol ediyorum, her şey çalışıyor gibi görünüyor.

Göstergeden iyi çalışır, bu tür (aşağıdaki dosya)

Dosyalar:
2.mq5  17 kb
[Silindi]  

Bir pozisyonu açıp kapatmakla karıştırılmaması için, tüm çizgileri ve göstergeyi doğru yönde ayarlamak ve tersini kullanmamak daha iyidir.

aksi takdirde kafanız karışabilir - özellikle ayarlarda bir fırsat olduğu için (tüm satırlar ve gösterge için tersi geçerlidir)

 input string    t3= "----- Indicators:        -----" ;               //
input string    short_name                   = "Examples\\MACD" ;   // Name Indicators
input bool      InpIndicators                = false ;             // Indicators: Start (true)
input bool      InpCloseOpposite             = false ;             // Close opposite
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_buy;           // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = open_sell;         // Trade command: (SellBuffer Indicators)
input string    t4= "----- Revers Buy><Sell   -----" ;               //
input bool      ObjRevers                    = false ;             //  Revers

sadece kodun kendisindeki girişi kaldırabilirsiniz
bunun gibi

 string    t4= "----- Revers Buy><Sell   -----" ;               //
bool      ObjRevers                    = false ;             //  Revers
[Silindi]  
Alexsandr San :

Bir pozisyonu açıp kapatmakla karıştırılmaması için, tüm çizgileri ve göstergeyi doğru yönde ayarlamak ve tersini kullanmamak daha iyidir.

aksi takdirde kafanız karışabilir - özellikle ayarlarda bir fırsat olduğu için (tüm satırlar ve gösterge için tersi geçerlidir)

sadece kodun kendisindeki girişi kaldırabilirsiniz
bunun gibi

Numara! göstergenin tersine ihtiyacı var

[Silindi]  

Gittikçe daha bilge oldum, hala Gösterge'den yeni fırsatlar elde etmeye çalışıyorum.

 input string    t3= "----- Indicators: SELL   -----" ;               //
input string    short_name                   = "2" ;               // Name Indicators "SELL"
input bool      InpIndicators                = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_sell;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = close_sells;       // Trade command: (SellBuffer Indicators)
input string    t4= "----- Indicators: BUY    -----" ;               //
input string    short_name1                  = "2" ;               // Name Indicators "BUY"
input bool      InpIndicators1               = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = open_buy;           // Trade command: (SellBuffer Indicators)

hayal kurabilirsiniz - hem bir göstergeyle hem de iki ile.

sadece onu almalısın, Gösterge - bunun gibi (fotoğraf)

https://www.mql5.com/ru/code/392

enstantane fotoğraf

( 2 ) olarak adlandırılan Göstergeyi kimyasal hale getirdim.

Dosyalar:
2.mq5  17 kb
[Silindi]  
Alexsandr San :

Gittikçe daha bilge oldum, hala Gösterge'den yeni fırsatlar elde etmeye çalışıyorum.

hayal kurabilirsiniz - hem bir göstergeyle hem de iki ile.

sadece onu almalısın, Gösterge - bunun gibi (fotoğraf)

https://www.mql5.com/ru/code/392

( 2 ) olarak adlandırılan Göstergeyi kimyasal hale getirdim.

1 dakika nasıl çalıştığını kontrol ediyorum - iyi çalışıyor

anlık görüntü2

[Silindi]  
Alexsandr San :

1 dakika nasıl çalıştığını kontrol ediyorum - iyi çalışıyor


WWW_Trailing_Line.mq5 iyi çalışıyor   96 kb , hata yok.

yalnızca, manuel uygulamada test cihazında bilgi ve test için bir soket eklemeniz gerekir.

panel

[Silindi]  
Alexsandr San :

WWW_Trailing_Line.mq5 iyi çalışıyor   96 kb , hata yok.

sadece, manuel uygulamada test cihazında bilgi ve test için bir soket eklemeniz gerekir.

bir soket eklendi - şimdi elinizi test cihazına doldurabilirsiniz.

Command_Trailing Satırı

onun ayarları neler

 //+------------------------------------------------------------------+
input string    t= "-----  Parameters         -----" ;               //
input string    Template                     = "ADX" ;             // Имя шаблона(without '.tpl')
input double    TargetProfit                 = 999999.99 ;         // Цель Баланса(Ваш Баланс + сумма)
input uint      maxLimits                    = 1 ;                 // Кол-во Позиции Открыть в одну сторону
input double    InpLots                      = 0.01 ;               // Lots
input int       InpTakeProfit                = 50 ;                 // Take Profit ("0"-No. 5<100)
input string    t0= "----- Trailing Line      -----" ;               //
input string    InpObjUpName                 = "TOP" ;             // Obj: TOP (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand    = close_sells;       // Obj:  command:
input string    InpObjDownName               = "LOWER" ;           // Obj: LOWER (Horizontal Line)
input ENUM_TRADE_COMMAND InTradeCommand     = close_buys;         // Obj:  command:
input ushort    InpObjTrailingStop           = 30 ;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort    InpObjTrailingStep           = 5 ;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string    t1= "----- Line name: 1       -----" ;               //
input string    InpNameR                     = "LineR" ;           // Line name (Horizontal Line or Trend Line)
input ENUM_TRADE_COMMAND InpTradeCommandR   = open_buy;           // Trade command:
input string    t2= "----- Line name: 2       -----" ;               //
input string    InpNameS                     = "LineS" ;           // Line name (Horizontal Line or Trend Line)
input ENUM_TRADE_COMMAND InpTradeCommandS   = open_sell;         // Trade command:
input string    t3= "----- Indicators: SELL   -----" ;               //
input string    short_name                   = "2" ;               // Name Indicators "SELL"
input bool      InpIndicators                = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_sell;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = close_sells;       // Trade command: (SellBuffer Indicators)
input string    t4= "----- Indicators: BUY    -----" ;               //
input string    short_name1                  = "2" ;               // Name Indicators "BUY"
input bool      InpIndicators1               = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = open_buy;           // Trade command: (SellBuffer Indicators)
input string    t5= "----- Button:            -----" ;               //
input ENUM_TRADE_COMMAND InpTradeCommandBut = open_buy;           // Obj(BUY):  command:Button: BUY
input ENUM_TRADE_COMMAND InTradeCommandBut  = open_sell;         // Obj(SELL):  command:Button: SELL
input int       TrailingStop_STOP_LEVEL      = 36 ;                 // Button: Trailing Stop LEVEL
Dosyalar:
[Silindi]  
Alexsandr San :

bir soket ekledi - şimdi elinizi test cihazına doldurabilirsiniz.

onun ayarları neler

Gözleme! OnDeinit'te eksik ekleme

grafikten bir uzmanı sildiğinizde - panel onsuz silinmez

kod açık, kendin kopyalayıp yapıştırabilirsin

 //+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
  {
   for ( int i= 0 ; i< ArraySize (_name); i++)
     {
       ObjectDelete ( 0 , Symbol ()+_name[i]);
     };
   EventKillTimer ();
//---
   Print ( TimeCurrent (), ": " , __FUNCTION__ , " reason code = " ,reason);
   Comment ( "" );
  }
//+------------------------------------------------------------------+
[Silindi]  
Alexsandr San :

bir soket ekledi - şimdi elinizi test cihazına doldurabilirsiniz.

onun ayarları neler

Bir fonksiyon daha eklemem gerekiyor.

örneğin - bir pozisyonun açılmaması için SATIŞ'ta bir sinyal tetiklendi - ancak bir Yatay çizgi çizildi, N'yi işaret etti ve zaten fiyat geri geldiğinde ve bu çizgiden - bir pozisyon açıldı.

EURUSDH1

[Silindi]  
Alexsandr San :

Bir fonksiyon daha eklemem gerekiyor.

örneğin - bir pozisyonun açılmaması için SATIŞ'ta bir sinyal tetiklendi - ancak bir Yatay çizgi çizildi, N'yi işaret etti ve zaten fiyat geri geldiğinde ve bu çizgiden - bir pozisyon açıldı.


Görünüşe göre bir şey oldu - kafa karıştırıcı olmamasına çalıştım, ilgilenen varsa - sorun, birlikte çözeriz.

enstantane fotoğraf

anlık görüntü2