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

 

Uh-huh, and a full head of alerts...

enough to remember the bar number along with the high/low update.

 
Excuse me, can someone help me ? ))
 
You need to determine if there is a value on the indicator buffer other than IndicatorEmptyValue(), which for arrows in 90% == 0, there will be your arrow. and remove "true" from the call.
 

There will be no mountain if:

int start(){
 if(Depth>Bars-1) Depth=Bars-1;
 double RVI=0;// Обратите внимание - нет нужды объявлять переменную на каждой итерации цикла!
        for(int i=1; i<Depth; i++){
                RVI = iRVI(NULL,0,ExtRVIPeriod,MODE_MAIN,i); 
                if(RVI < mini){
                        mini=RVI;
                        Alert("На свече ",i," mini = ",mini);
                }
                if(RVI > maxi){
                        maxi=RVI;
                        Alert("На свече ",i," maxi = ",maxi);
                }
        }
return(0);
}// Автору ведь нужно всего лишь небольшой период, а не все барсы :)
 
Manual, please set the tab size in the forum settings to 2-3 spaces. You insert the code and the brackets go God knows where...
 
The author needs to get the maximum and minimum values at the output of their loop, and in the EA. better redundant code. than redundant gemor.
 

Can the deinit() function be called from the start() function? For example, I want to make Expert Advisor to unload itself when specified conditions are met.

 
FAQ:
The author needs to get the values of maximum and minimum at the output of their loop, and in the EA. better redundant code. than redundant pain.


I see. Perhaps I overdid and inattentively read the task - it's been a long day - fatigue is taking its toll.

The author needs to get the values of maximum and minimum in the output of their loop, better redundant code than redundant mess.

 
skyjet:
Excuse me, can someone help me ? ))
Here's a snippet of code from Integer's EA, which shows the work with the arrow indicator.
         double bv=iCustom(NULL,0,"MaSignalFunction",0,1);//стрелка "Вверх" в буфере №0
         double sv=iCustom(NULL,0,"MaSignalFunction",1,1);//стрелка "Вниз"  в буфере №1
         bool BuySignal=false;
         bool SellSignal=false;
            if(bv!=0 && bv!=EMPTY_VALUE){
               BuySignal=true;
            }
            if(sv!=0 && sv!=EMPTY_VALUE){
               SellSignal=true;
            }
            
            if(BuySignal || SellSignal){
               //если разрешено обратное закрытие, вызывается ф-ия закрытия встречных ордеров 
               if(CloseOnRev)fOrderCloseMarket(SellSignal,BuySignal);
               int BuyCount,SellCount;
               int Total=fMarketOrdersTotal(BuyCount,SellCount);
                  if(Total==-1){
                     return(0);
                  }
                  if(Total<MaxCount || MaxCount==-1){
                     if(BuySignal){
                        if(BuyCount<MaxBuyCount || MaxBuyCount==-1){
                           if(LastBuyTime!=iTime(NULL,TimeFrame,0)){
                              Print("BuySignal ",CommentOrder);                          
                              fOrderOpenBuy();//вызывается ф-ия открытия buy
                           }  
                        }
                     }
                     if(SellSignal){
                        if(SellCount<MaxSellCount || MaxSellCount==-1){
                           if(LastSellTime!=iTime(NULL,TimeFrame,0)){
                              Print("SellSignal ",CommentOrder);
                              fOrderOpenSell();//вызывается ф-ия открытия sell                           }
                        }
                     }
                  }
                  
            }
            
  
 
silhouette:

Can the deinit() function be called from the start() function? For example, I want to make Expert Advisor to unload itself when specified conditions are met.


You cannot call deinitialization from EA start, but you can give a command to stop using return