[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 601

 

How do I use object crate and object set to draw a horizontal line in a stochastic window, for example?

 

How can I use object crate and object set to draw a horizontal line in a stochastic window, for example?

 

I want to use Ramus volumes in MT4, they seem to have more realistic volumes.

 

Please advise how to solve the problem!

I am testing an EA by ticks, the EA uses not only the standard indices, but also custom iCustom ones.

After the test is passed (without visualization), I press the Open Chart button and the following screen appears:

WHERE ARE THE INDICATORS used by the EA? I remember that they were shown before, but now they aren't... How to make them appear not by adding them manually, but automatically, when viewing a chart after testing????

 
Good afternoon, all. Please advise how to attach a sound to the indicator. Although in programming I am still a dummy, maybe someone will just add sound to an indicator at your leisure. I would be grateful.
Files:
 
Where does dividing by zero come from? One minute it's working in the tester, then hr-r-r-r-r... and it doesn't work... and it doesn't open any positions. I look in the log and there's a division of zero and don't cough... And as soon as I run the tester (it's paused), it doesn't even get to the opening criteria... ... we immediately divide something by zero and it doesn't work any more... It would be one thing if I changed something in the code... But as it is... it's a miracle...
Has anyone experienced such a miracle?
 
#property  indicator_level1 0.3
#property  indicator_level2 0.7
//---- 
extern int        period_MA            = 5,
                  period_DeMarker      = 14;
//---- 
double            DeMarker_buffer0[],
                  MA_buffer1[],
                  Signal_Buffer2[];
                  
#define SIGNAL_BAR 1
//+------------------------------------------------------------------+
//|   
//+------------------------------------------------------------------+
int start()
  {
  int    i,limit=ArraySize(DeMarker_buffer0);
         ArraySetAsSeries(DeMarker_buffer0,false);
  int    counted_bars=IndicatorCounted();
//----
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
  for(i=limit; i>=0; i--)
  DeMarker_buffer0[i]=iDeMarker(NULL,0,14,1);
//---- 
  for(i=limit; i>=0; i--)
  MA_buffer1[i]=iMAOnArray(DeMarker_buffer0,limit,5,0,MODE_LWMA,i);
//---- 
          static int PrevSignal = 0, PrevTime = 0;
//---- 
          if(SIGNAL_BAR > 0 && Time[0] <= PrevTime) 
              return(0);
//---- 
          PrevTime = Time[0]; 
//---- 
          if(PrevSignal <= 0)
            {
//---- 
                if(MA_buffer1[SIGNAL_BAR] - 0.3 > 0 && 0.3 - MA_buffer1[SIGNAL_BAR+1] >= 0)
                   {
//---- 
                           PrevSignal = 1;
//---- 
                                Alert( "MA(", Symbol(), ", ", Period(), ")  -  BUY!!!" );
                       }
            }
//----
          if(PrevSignal >= 0)
            {
                     if(0.7 - MA_buffer1[SIGNAL_BAR] > 0 && MA_buffer1[SIGNAL_BAR+1] - 0.7 >= 0)
                       {
                                PrevSignal = -1;
                                Alert("MA(", Symbol(), ", ", Period(), ")  -  SELL!!!");
                       }
            }
//----  
   return(0);
  }
                   
I've written such an EA, but it won't display any messages for some reason. Can you please tell me what's wrong with it?
 
41ckm39fi:
I have written such an EA but it won't display any message. Please advise what is the error.

This might be the indicator, not the Expert Advisor...

The thing is that after you run it on a nth tick when the first time the condition is triggered

if(MA_buffer1[SIGNAL_BAR] - 0.3 > 0 && 0.3 - MA_buffer1[SIGNAL_BAR+1] >= 0)

will execute PrevSignal = 1;

and more, by the condition if(PrevSignal <= 0)

there will be no alerts... The same is true for the alerts on the second tick...

If no alerts are triggered at all, it means the conditions for them don't come at all...

 
artmedia70:
Where does dividing by zero come from? One minute it's working in the tester, then hr-r-r-r-r... and it doesn't work... and it doesn't open any positions. I look in the log and there's a division of zero and don't cough... And as soon as I run the tester (it's paused), it doesn't even get to the opening criteria... ... we immediately divide something by zero and it doesn't work any more... It would be one thing if I changed something in the code... But as it is... it's a miracle...
Has anyone experienced such a miracle?
Look for division by a variable, 100% you'll find the value 0 in it...
 
Noterday:

Please advise how to solve the problem!

I am testing an EA by ticks, the EA uses not only the standard indices, but also custom iCustom ones.

After the test is passed (without visualization), I press the Open Chart button and the following screen appears:

WHERE ARE THE INDICATORS used by the EA? I remember that they were shown before, but now they aren't... How to make them appear not by adding them manually, but automatically, when viewing a chart after testing????

it seems that indicators called via iCustom() should not be displayed. all i-indicators (iMa() etc.) are displayed, but there is a function for hiding such indicators HideTestIndicators()
Reason: