[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 201

 
Nothing has changed, same errors(((
 
ZS - lot = 0 - will cause an error when trying to place a trade...
 
Please help me to understand. I have a doubleminus_1 Expert Advisor (the code reminds me of Ilan 1.6 Pipstep). Recently, more and more often trades open only in one direction, but after a few hours everything is normal again. The frequency varies and does not depend on volatility. Since the EA code is too long to add here, I am attaching the EA file itself.

	          
Files:
 
ierehon:
Please help me to understand. I have a doubleminus_1 Expert Advisor (the code reminds me of Ilan 1.6 Pipstep). Recently, more and more often trades open only in one direction, but after a few hours everything is normal again. The frequency varies and does not depend on volatility. Since the EA code is too long to add here, I am attaching the EA file itself.

This is nonsense. Try it on another brokerage company. For example this one works according to algorithm without any questions.
 
Roman.:

This is nonsense. Try it on another DC. For example, this one - it works according to the algorithm without any questions.
I do not understand why it happens, but it is a fact. So it works fine, it just has periods when it opens trades only in one direction. According to my observations, this happens after a sharp rise or fall without serious correction. The only thing I can think of is that it might be related to RSI, but how exactly I do not know.
 
ierehon:
I don't understand why this happens, but it's a fact nonetheless. It works fine, but there are periods when it only opens trades in one direction. According to observations, this happens after a sharp rise or fall without serious corrections. The only thing I can think of is that it might be related to RSI, but how exactly I do not know.
How so? Study carefully the signal part of the Expert Advisor... There inputs are made when the RSI indicator crosses certain levels. Everything works correctly if you can't figure it out, so don't sweat it...
 
Roman.:
How so? Study carefully the signal part of the Expert Advisor... There inputs are made when the RSI indicator crosses certain levels. Everything works correctly, if you can't figure it out, so don't sweat it...
Then what could it be? No time limit, no limit on number of orders either (worth more than 1000)...
 
ierehon:
Then what could it be? No time limit, no limit on the number of orders either (worth more than 1000)...

It is NOT the time of execution (triggering) of signals to enter (averaging) the market. You have to wait...
 
SkinnerDE:

Hi all. Please help me find a bug in the code, I'm exhausted - I can't do anything.

Most likely in the last part.


ObjectSetText

at the very top to what does it refer to? Take it away.

 

I am writing an indicator that calculates the average daily range for a specified period. When attached to the chart, the chart is displayed normally:

But after receiving a new quote, the value changes dramatically.

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red

extern int History=1000;
extern int D1_Period=21;
//+------------------------------------------------------------------+
double Buf_0[];
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0, Buf_0);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
   return(0);
  }

int deinit()
  {

   return(0);
  }

int start()
  {
   int Counted_Bars, i, n, count=0;
   double L_High, L_Low, L_Range, Sum=0, range;
//+------------------------------------------------------------------+
   Counted_Bars=IndicatorCounted();
   i=Bars-Counted_Bars-1;
   if(i>History-1)
      i=History-1;
   while(i>=0)
    {
     for(n=i;n<=D1_Period+i;n++)
      {
        L_High=iHigh(NULL,PERIOD_D1,n);
        L_Low =iLow(NULL,PERIOD_D1,n);
        L_Range=(L_High-L_Low)/Point;
        Sum=Sum+L_Range;
        count++;         
      }
     range=MathRound(Sum/count);
     Buf_0[i]=range; 
     i--;
    }   
   return(0);
  }
//+------------------------------------------------------------------+
What is the reason?