Hatalar, hatalar, sorular - sayfa 2409

 
Sevgili geliştiriciler! Siteyi düzeltecek misin? Nasıl giriş yapılmaz - ürün güncelleme bildirimi. Bu uyarıya bakıyorum ama tekrar görünüyor. Bu olmamalı!
 
Alexey Kozitsyn :
Sevgili geliştiriciler! Siteyi düzeltecek misin? Nasıl giriş yapılmaz - ürün güncelleme bildirimi. Bu uyarıya bakıyorum ama tekrar görünüyor. Bu olmamalı!


Ürün için bu hatayı yaşamıyorum.

Mesajları okumamak gibi yaygın bir hata vardır.

Hata, birkaç sekme açıkken ortaya çıkar, siz onları kapatana kadar okunmazlar.

Bir şey daha var - bu mesaja iki kez girmeniz gerekiyor - o zaman okundu olarak işaretlenecek.

Belki bu geliştiricilere yardımcı olur.

 

Gösterge tablosu kaybolur (BR-4.19 değilse vadeli işlem sözleşmeleri için gösterge, ardından int NextFutMonth = 3 girin; //Sonraki vadeli işlemler (ay))

 //+------------------------------------------------------------------+
//|                                                   BR_Scalper.mq5 |
//|                                      Copyright 2019 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019 prostotrader"
#property link        "https://www.mql5.com"
#property version    "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots    1

//--- plot Label1
#property indicator_label1    "Spread"
#property indicator_type1    DRAW_LINE
#property indicator_color1    clrYellow
#property indicator_style1    STYLE_SOLID
#property indicator_width1    1

//#property indicator_maximum 30
//#property indicator_minimum -30

#define on_call - 111
//
input int NextFutMonth = 1 ;     //След фьючерс (мес.)
input int aBars = 30 ;           //Бары  
//
double Buff[];
double pr_last, sec_last;
string sec_symbol;
bool pr_book, sec_book;
int event_cnt;

//+------------------------------------------------------------------+
//| Indicator Set second Symbols function                            |
//+------------------------------------------------------------------+
string SetSecSymbol( const string aSymbol)
{
   int str_tire = StringFind (aSymbol, "-" );
   int str_tochka = StringFind (aSymbol, "." , str_tire);
   int str_size = StringLen (aSymbol);
   if ((str_tire > 0 ) && (str_tochka > 0 ) && (str_size > 0 ))
  {
     string str_month = StringSubstr (aSymbol, str_tire + 1 , str_tochka - str_tire - 1 );
     string str_year = StringSubstr (aSymbol, str_tochka + 1 , str_size - str_tochka - 1 );
     long aMonth = StringToInteger (str_month);
     long aYear = StringToInteger (str_year);
     if ((aMonth > 0 ) && (aYear > 0 ))
    {
       long n_month = aMonth + long (NextFutMonth);
       long add_year = (n_month - 1 ) / 12 ;
      aYear += add_year;
      str_year = IntegerToString (aYear); 
      aMonth = n_month - add_year * 12 ;
      str_month = IntegerToString (aMonth);
       return ( StringSubstr (aSymbol, 0 , str_tire + 1 ) + str_month + "." + str_year);
    } 
  }
   return ( "" );
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
{
   int a_bars = Bars ( Symbol (), PERIOD_CURRENT );
   if (a_bars < aBars + 1 )
  {
     Alert ( "На графике не хватает баров!" );
     return ( INIT_FAILED );
  } 
  event_cnt = 0 ;
  sec_symbol = SetSecSymbol( Symbol ());
   if ( SymbolSelect (sec_symbol, true ) == false ) return ( INIT_FAILED );
  pr_book = MarketBookAdd ( Symbol ());
  sec_book = MarketBookAdd (sec_symbol);
   IndicatorSetInteger ( INDICATOR_DIGITS , 0 );
   IndicatorSetString ( INDICATOR_SHORTNAME , "BR_Scalper" );
//---  
   SetIndexBuffer ( 0 , Buff, INDICATOR_DATA );
   PlotIndexSetDouble ( 0 , PLOT_EMPTY_VALUE , EMPTY_VALUE );
   ArraySetAsSeries (Buff, true );
   return ( INIT_SUCCEEDED );
}
//+------------------------------------------------------------------+
// Custom indicator DeInit function                                  |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason )
{
   if (pr_book == true ) MarketBookRelease ( Symbol ());
   if (sec_book == true ) MarketBookRelease (sec_symbol);
   if (reason == REASON_INITFAILED )
  {
     Print ( "Индикатор удалён! Причина - ошибка инициализации." );
     string short_name = ChartIndicatorName ( ChartID (), 1 , 0 );
     ChartIndicatorDelete ( ChartID (), 1 , short_name); 
  }
}
//+------------------------------------------------------------------+
// Custom indicator On book event function                           |
//+------------------------------------------------------------------+
void OnBookEvent ( const string & symbol )
{
   if ((symbol == Symbol ()) || (symbol == sec_symbol))
  {
    sec_last = SymbolInfoDouble (sec_symbol, SYMBOL_LAST );
    pr_last = SymbolInfoDouble ( Symbol (), SYMBOL_LAST );
     double price[]; 
     OnCalculate ( event_cnt, event_cnt, on_call, price ); 
  }
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const int begin,
                 const double &price[])
{
   if (prev_calculated == 0 )
  {
     ArrayInitialize (Buff, EMPTY_VALUE );
  }
   else
  {
     if (begin == on_call)
    {
       for ( int i = aBars - 1 ; i > 0 ; i--)
      {
        Buff[i] = Buff[i - 1 ];
      }
    }
     else
    {
     sec_last = SymbolInfoDouble (sec_symbol, SYMBOL_LAST );
     pr_last = SymbolInfoDouble ( Symbol (), SYMBOL_LAST ); 
     Buff[aBars] = EMPTY_VALUE ;
    } 
    Buff[ 0 ] = (sec_last - pr_last) / Point ();
  } 
//---    
  event_cnt = rates_total;  
//--- return value of prev_calculated for next call
   return (rates_total);
}
//+------------------------------------------------------------------+

Ama koyduğunda

 #property indicator_maximum 30
#property indicator_minimum - 30

o zaman iyi çalışıyor

 

Test cihazı, başka bir enstrümanın fiyat teklifleriyle anlaşmaları kapatır.


1. Açılış eurusd fiyatı 1.30935.

2. 1.60704'ü kapatın. Böyle bir fiyat yoktu ama o zamanlar başka bir gbpusd aracı için böyle bir fiyat vardı.





Test, eurusd, gbpusd olmak üzere iki araç üzerinde gerçekleştirilir. gbpusd hariç tutulursa, hata kaybolur.


 
Aleksey Sergan :

Test cihazı, başka bir enstrümanın fiyat teklifleriyle anlaşmaları kapatır.


1. Açılış eurusd fiyatı 1.30935.

2. 1.60704'ü kapatın. Böyle bir fiyat yoktu ama o zamanlar başka bir gbpusd aracı için böyle bir fiyat vardı.





Test, eurusd, gbpusd olmak üzere iki araç üzerinde gerçekleştirilir. gbpusd hariç tutulursa, hata kaybolur.


Bu mucize danışmanın kodu nerede? Sınıflarla çalıştığınızı ve bir yerde statik bir değişken kullandığınızı %99 veriyorum.

 
Vladimir Karputov :

Bu mucize danışmanın kodu nerede? Sınıflarla çalıştığınızı ve bir yerde statik bir değişken kullandığınızı %99 veriyorum.

Vladimir, şaka mı yapıyorsun?

 
Andrey Barinov :

Vladimir, şaka mı yapıyorsun?

HalaAleksey Sergan'dan cevap bekliyorum   . Cevaba bağlı olarak, sorunun ikinci bir önde gelen kısmı olacaktır.

 
Vladimir Karputov :

HalaAleksey Sergan'dan cevap bekliyorum   . Cevaba bağlı olarak, sorunun ikinci bir önde gelen kısmı olacaktır.

anladım. O yüzden şaka yapma...

Bazen bir terminal hatası sadece bir terminal hatasıdır.
 
Vladimir Karputov :

Bu mucize danışmanın kodu nerede? Sınıflarla çalıştığınızı ve bir yerde statik bir değişken kullandığınızı %99 veriyorum.

Birkaç bin satır kod. Başvuru yapmanın bir anlamı yok. statik değişkenler yoktur. Sınıflar var. Her durumda, bu bir testçi hatasıdır.

 
Andrey Barinov :

anladım. O yüzden şaka yapma...

Bazen bir terminal hatası sadece bir terminal hatasıdır.

nu-nu :)