[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 471

 

The documentation says that the SetIndexEmptyValue function is used to specify an "empty" value. That is, we specify at which value we do not need to draw anything at all. It is very convenient in our case as signals do not occur on every bar. It works as follows. When you do not need to draw the arrow on the current bar, you assign an "empty" value to the appropriate entry of the data buffer, in our case 0.

Something I don't understand. If something is drawn by the signal, it will not be drawn without the signal. Then what is the purpose of this function in general?

 
Elektronik:

Everything has already been done for you and it works fine

KimIV01.11.2006 18:49

I recommend my tried and tested code



https://forum.mql4.com/ru/4689


Thanks for the reply, but I would like to know why it doesn't work for me:)
 
hoz:

The documentation says that the SetIndexEmptyValue function is used to specify an "empty" value. That is, we specify at which value we do not need to draw anything at all. It is very convenient in our case as signals do not occur on every bar. It works as follows. When you do not need to draw the arrow on the current bar, you assign an "empty" value to the appropriate entry of the data buffer, in our case 0.

Something I don't understand. If something is drawn by the signal, it will not be drawn without the signal. Then what is the purpose of this function in general?


It is customary for the computer to explicitly indicate that there is no value. Then it doesn't seem to be zero at all. Imagine drawing a buffer - here it has the value 1.2903, 1.2905, 1.2904... And then suddenly 0. In these mists the indicator lines will suddenly have to dive below the window!!!
 
hoz:

The documentation says that the SetIndexEmptyValue function is used to specify an "empty" value. That is, we specify at which value we do not need to draw anything at all. It is very convenient in our case as signals do not occur on every bar. It works as follows. When you do not need to draw the arrow on the current bar, you assign an "empty" value to the appropriate entry of the data buffer, in our case 0.

Something I don't understand. If something is drawn by the signal, it will not be drawn without the signal. Then what is the purpose of this function in general?

This function fills the array (in this case, the indicator buffer) with an empty value EMPTY_VALUE = 0x7FFFFFFFF.
 
drknn:


Actually, there is a special type of variable in the language - color is called. For example:

double Velichina;

MyLine;

Velichina=2.569;

MyLine=Red;


I had it like this.
  OrderSend( NULL, OP_BUY, lot, Ask, 3, NormalizeDouble( Bid- (stoplos*Point),Digits),   NormalizeDouble( Ask+( takeprofit*Point),Digits), NULL, magicnumber, 0, 00 FF33);  }
           
What's he supposed to do, write colour in there?
 
Dimka-novitsek:

I had it like this What should he write there, a special color, or what?

No, you can write simply Red instead of 00FF33, or any colour from Web-colors table - open this link - there are enough colours not to use hexadecimal code.
 
Robot
//+------------------------------------------------------------------+
//|                                                     советник.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"


  extern double  lot=1;                          
  extern int taymfreym=0 ;                           
  extern double  stoplos=20 ;                          
  extern double  takeprofit=50 ; 
  extern double  magicnumber=350//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
            double strela1 = iCustom(NULL, taymfreym, "индикатор", 0, 1);
            double strela2 = iCustom(NULL, taymfreym, "индикатор", 1, 1);
            int BUY=0,SELL=0;int ticket; 
            Print (  " strela1 " , strela1 , "   strela2  " , strela2  );
            
    
            
            for(int i=1; i<=OrdersTotal(); i++) {  
            if (OrderSelect(i-1,SELECT_BY_POS)==true) // Если есть следующий
        {                                       // Анализ ордеров:
         if (OrderSymbol()!=Symbol( ) )continue;      // Не наш фин. инструм
         if (OrderMagicNumber( ) !=magicnumber)continue;
         if (OrderType()==0){ BUY++; ticket=OrderTicket( );}
         if (OrderType()==1) {SELL++;ticket=OrderTicket( );}    } }
         
   if (strela1>strela2&&BUY==0&&SELL==0){               
            
           OrderSend( NULL, OP_BUY, lot, Ask, 3, NormalizeDouble( Bid- (stoplos*Point),Digits), 
  NormalizeDouble( Ask+( takeprofit*Point),Digits), NULL, magicnumber, 0, CLR_NONE);  }
           
           
   if (strela1<strela2&&BUY==0&&SELL==0){  
   
            OrderSend( NULL, OP_SELL, lot, Bid, 3, NormalizeDouble( Ask- (stoplos*Point),Digits), 
  NormalizeDouble( Bid+( takeprofit*Point),Digits), NULL, magicnumber, 0, CLR_NONE) ; }
            
            
  if (strela1>strela2&&BUY==0&&SELL!=0){ 
   OrderSelect(ticket, SELECT_BY_TICKET);
   OrderClose(  ticket , OrderLots( ) , OrderOpenPrice( ) , 3, CLR_NONE);                 
   OrderSend( NULL, OP_BUY, lot, Ask, 3, NormalizeDouble( Bid- (stoplos*Point),Digits),  
 NormalizeDouble( Ask+( takeprofit*Point),Digits), NULL, magicnumber, 0, CLR_NONE);  }         
      
  if (strela1<strela2&&SELL==0&&BUY!=0){ 
   OrderSelect(ticket, SELECT_BY_TICKET);
   OrderClose(  ticket , OrderLots( ) , OrderOpenPrice( ) , 3, CLR_NONE);                 
   OrderSend( NULL, OP_SELL, lot, Bid, 3, NormalizeDouble( Ask- (stoplos*Point),Digits),  
 NormalizeDouble( Bid+( takeprofit*Point),Digits), NULL, magicnumber, 0, CLR_NONE) ; }
      
            
            
//----
   return(0);
  }
//+------------------------------------------------------------------+
It's a place
 double strela1 = iCustom(NULL, taymfreym, "индикатор", 0, 1);
 double strela2 = iCustom(NULL, taymfreym, "индикатор", 1, 1);

The strela2 does not work, its value is -1. Task if the arrow is up, buy order and vice versa. Or maybe I'm not writing it right at all!!!

I amusing thisiCustom for the first time. Is it correct to compare strela1 and strela2 inthis way? What kind of values I'm getting - well, I understand that it's

the first and second buffers, but no more than that.

What does it draw the arrows with?

 

Indicator

/*ДЕКОМПИЛ УДАЛЕН, ВАМ ПРЕДУПРЕЖДЕНИЕ*/

What does it draw the arrows with anyway?

 

What does the word "tralit" mean?

The quote reads in full like this:

<Advisor uses"Alligator" indicator signals for inputs, moves the position to Breakeven and trawls with a set step.

 
I don't get it! I had a guy send me an indicator in the mail. Where did he decompile it from? Yes, I've seen quite similar indicators more than once. Please put them back where they belong!
Reason: