Errors, bugs, questions - page 30

 
fvdtrejder:

Same as above no need to attach screenshot because immediately after launching mt5setup.e[e] the program immediately flies off and says setup error

I downloaded the program to my netbook, the program is running and I don't understand what's wrong.

Do you have an antivirus or firewall (any network and antivirus protection)? If so, which one...
 

I put a custom indicator on the chart -->

it draws -->

remove it from the chart -->

it disappears -->

put it back on the chart -->

and silence no re-drawing when I call the indicator again ?????????????

Although no sometimes it loads (in general, floating glitch), the indicator is attached

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot LRma
#property indicator_label1  "LRma"
#property indicator_type1   DRAW_LINE
#property indicator_color1  Red
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
input string             symbol      ="EURUSD";
input int                MA_Period   =25;          // период MA
input int                MA_shift    =0;           // сдвиг индикатора
input ENUM_APPLIED_PRICE price       =PRICE_OPEN;  // тип цены 
//--- indicator buffers
double  LRma[],L[],S[],iPoint,iiMA;

int Lwma,Sma;// Хендлы машек
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,LRma,INDICATOR_DATA);
   SetIndexBuffer(1,L,INDICATOR_DATA);
   SetIndexBuffer(2,S,INDICATOR_DATA);
   Lwma=iMA(symbol,0,MA_Period+1,MA_shift,MODE_LWMA,price);
   Sma=iMA(symbol,0,MA_Period+1,MA_shift,MODE_SMA,price);
   iPoint=1.0/SymbolInfoDouble(symbol,SYMBOL_POINT);
   iiMA=1.0/MA_Period;
   IndicatorSetString(INDICATOR_SHORTNAME,"LRma_symbol_"+symbol);
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   int count=rates_total-prev_calculated;
   if(count==0)count=1;
   if(CopyBuffer(Lwma,0,0,count,L)!=-1)
     {
      if(CopyBuffer(Sma,0,0,count,S)!=-1)
        {
         for(int i=0;i<count;i++)
            LRma[i]=(L[i]-S[i])*6*iPoint*iiMA;
        }
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
Files:
 
Interesting:
Do you have antivirus or firewall (any network and antivirus protection)? If so, which one...
 
fvdtrejder:
There's Dr. Web, I turned it off and it's the same
 

And there's also this crap instead of the [Experts] button on the Cntl+T Toolbar


 
Urain:

I put a custom indicator on the chart -->

it draws -->

remove it from the chart

it disappears -->

put it back on the chart -->

and silence no rendering at recalled indicator ?????????????

SZS although no sometimes it loads (in general, floating glitch), the indicator is attached


Again, all over again. What's the idea of writing a symbol in the parameters (and forget to process it NORMALLY in the body of the indicator).

In the initialization block with a bummer processed this parameter, and then what to do with it is a question ...


First of all, I advise you to change the lines in the initialization block to those

//--- indicator buffers mapping
   SetIndexBuffer(0,LRma,INDICATOR_DATA);
   SetIndexBuffer(1,L,INDICATOR_DATA);
   SetIndexBuffer(2,S,INDICATOR_DATA);

   Lwma=iMA(symbol,Period(),MA_Period+1,MA_shift,MODE_LWMA,price);
   Sma=iMA(symbol,Period(),MA_Period+1,MA_shift,MODE_SMA,price);

   iPoint=1.0/SymbolInfoDouble(symbol,SYMBOL_POINT);
   iiMA=1.0/MA_Period;
   IndicatorSetString(INDICATOR_SHORTNAME,"LRma_symbol_"+symbol);
//---

And then think again what's going on in your calculator...


PS

In any case if you want to indicate the current timeframe better use either PERIOD_CURRENT or Period()

 
Urain:

I put a custom indicator on the chart -->

it draws -->

remove it from the chart -->

it disappears -->

put it back on the chart -->

and silence no drawing when calling the indicator again ?????????????

HOWEVER, sometimes it fails to load (in general, floating glitches), the indicator is attached


My custom indicator works stable and without glitches.

I have only one buffer for indicator calculation, but I have three bindings. I wonder if this is the reason.

#property indicator_buffers 1
#property indicator_plots   1
   SetIndexBuffer(0,LRma,INDICATOR_DATA);
   SetIndexBuffer(1,L,INDICATOR_DATA);
   SetIndexBuffer(2,S,INDICATOR_DATA);
 
Interesting:

Here we go again. What's the excess in your parameters to write what symbol we use (and forget to NORMALLY process it in the body of the indicator).

In the initialization block with a bummer processed this parameter, and then what to do with it is a question ...


To start with, I advise to change the lines in the initialization block to these

And then think again what's going on in calculator of the indicator...
I'm a bit confused, I haven't found any difference between my code and what you're suggesting.
 
DC2008:

I have a stable and glitch-free operation of your indicator.

Why is one buffer declared for calculating the indicator, but three buffers are linked? Maybe that is the reason?

Maybe, but sometimes it works, although when I set 3, I get 3 values in short name and I need only one of the main buffer.
 
Urain:
I'm a bit confused, I couldn't find any difference between my code and the one you suggest.

It's not about initialisation there. And it's not even about those two lines that cause the Mashkeh.

Even if we assume that the SIMON parameter is really needed there (I personally doubt it), the work with buffers is lame, and about the calculator block I'm not even talking...