Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 500

 
artmedia70:
Chukcha hunter? Why in the eye?


I write and he reads with his eyes! If I spoke, then he would listen with his ears!
 
artmedia70:
No one here has ever been able to answer every question you ask. There are two wonderful links at the top left. There's a lot of stuff there. There's also a forum link at the top right where you can find the Forum Navigator and Answers to Frequently Asked Questions. Highly recommended reading!

Thanks for the link! I haven't been there yet, although I've been visiting your site for a long time.

 
Kot103:

Thanks for the link! I haven't been there yet although I've been visiting your site for a while.




So you should know what you have written! Isn't there a textbook for your dialectic? "...I crossed there...", I hope you didn't run over anyone there?!
 
borilunad:

So figure out what you've written! Isn't there a textbook for your dialectic? "...I crossed there...", I hope you didn't run anyone over?!

I've just never communicated on a forum, so I'm not very good at formulating a thought yet.

 
Kot103:

I've just never communicated on the forum, so I'm not very good at formulating a thought just yet.




That's the thing about forming a thought, the way you think! If you thought correctly, you would write correctly too!

The word "once" is pronounced with an accent on the 1st syllable and means "once". It should have been spelled with an "and" never, which is stressed on the last syllable!

"Badly" is spelled with the ending in "o", the "a" indicating the feminine gender. By the way, programming is much more complicated, you have to have both an understanding of logic and be friends with mathematics at a fairly advanced level. You don't have to like but respect the language, thereby respecting the people you are addressing!

 
how do I draw a horizontal line between two points and a vertical line? ..... I'm telling you I need a rectangle to draw at a given price and time interval
 
how do I draw a horizontal line between two points and a vertical line? ..... I'm telling you I need a rectangle to draw at a given price and time interval
 
Zver4991:
how do I draw a horizontal line between two points and a vertical line? ..... I'm just saying I need a rectangle to draw at a given price and time interval
//+----------------------------------------------------------------------------+
void SetRectangle(color cl, string nm="", datetime t1=0, double p1=0, datetime t2=0, double p2=0, int sz=0, bool bk=true) {
   if (ObjectFind(nm)<0) ObjectCreate(nm, OBJ_RECTANGLE, 0, 0, 0, 0, 0);
   ObjectSet(nm, OBJPROP_TIME1   ,t1);
   ObjectSet(nm, OBJPROP_PRICE1  ,p1);
   ObjectSet(nm, OBJPROP_TIME2   ,t2);
   ObjectSet(nm, OBJPROP_PRICE2  ,p2);
   ObjectSet(nm, OBJPROP_COLOR   ,cl);
   ObjectSet(nm, OBJPROP_WIDTH   ,sz);
   ObjectSet(nm, OBJPROP_BACK    ,bk);
}
//+----------------------------------------------------------------------------+

Challenge:

SetRectangle(clrBlue,"Прямоугольник",Time[10],Low[10],Time[0],High[0]);

If bk=true, it will be filled with colour, if false, it will just "frame" ... sz at "just a frame" is the width of the "frame" lines

 
r772ra:


Yes!!!! no I don't think so, but it is.

What's the BarShift variable, though, throw the code, see what's wrong there.


Here's a copy of the primary message it says it all

I had to ask for help (I've been working on this for months, many programmers have tried to help, the question is not new.) So the multicurrency indicator works for all pairs specified in the market overview window, it shows the amount of motion in pips, all pairs that move in the direction of the previous move plus, those against - are minus. everything runs like clockwork strictly according to this algorithm, the calculation cycle over a week. I am saying all this to make it clear that the indicator works as it should. But for all his calculations and shows he takes the closing bar (0 - current, +1 - previous, +2 - before the previous one), and I need to take the closing of the weekly bar (0 - current, +1 - previous, +2 - before the previous one). For those who don't understand, it is a weekly bar close, and not a weekly bar size close (in seconds, minutes, hours, days). The indicator will be set on a shorter timeframe than the weekly one. Two more indicators are already built by me I can explain each line

MQL-code:
#property indicator_separate_window#property indicator_buffers 1#property indicator_color1 Lime//--- buffersdouble ExtMapBuffer1[];int TotalSymbols;string SymbolName[1];// -------------------------------------------------------------------int init() { SetIndexStyle(0, DRAW_HISTOGRAM); SetIndexBuffer(0, ExtMapBuffer1); int hFile = FileOpenHistory("symbols.sel", FILE_BIN|FILE_READ); TotalSymbols =(FileSize(hFile) - 4) / 128; ArrayResize(SymbolName, TotalSymbols); for(int i = 0; i < TotalSymbols; i++) { FileSeek(hFile, 4 + i * 128, SEEK_SET); SymbolName[i] = FileReadString(hFile, 12); } FileClose(hFile);

   return(0); }// -------------------------------------------------------------------int deinit() { return(0); }// -------------------------------------------------------------------int start() { int StartBar = Bars - IndicatorCounted() - 1; for(int i = StartBar; i >= 0; i--) { if(TimeDayOfWeek(Time[i]) < TimeDayOfWeek(Time[i+1])) ExtMapBuffer1[i] = 0; else ExtMapBuffer1[i] = ExtMapBuffer1[i+1]; for(int j = 0; j < TotalSymbols; j++) { int BarShift = iBarShift(SymbolName[j], 0, Time[i], true)
	    	 
           if(iClose(Sym bolName[j], 0, BarShift) > iClose(SymbolName[j], 0, BarShift+1)&&iClose(SymbolName[j], 0, BarShift+1) >= iClose(SymbolName[j], 0, BarShift+2)) ExtMapBuffer1[i] +=(iClose(SymbolName[j], 0, BarShift) - iClose(SymbolName[j], 0, BarShift+1)) / MarketInfo(SymbolName[j], MODE_POINT)
           if(iClose(Sym bolName[j], 0, BarShift) < iClose(SymbolName[j], 0, BarShift+1)&&iClose(SymbolName[j], 0, BarShift+1) < iClose(Sym bolName[j], 0, BarShift+2)) ExtMapBuffer1[i] +=(iClose(SymbolName[j], 0, BarShift+1) - iClose(SymbolName[j], 0, BarShift)) / MarketInfo(SymbolName[j], MODE_POINT);
           if(iClose(Sym bolName[j], 0, BarShift) > iClose(SymbolName[j], 0, BarShift+1)&&iClose(SymbolName[j], 0, BarShift+1) < iClose(Sym bolName[j], 0, BarShift+2)) ExtMapBuffer1[i] +=(iClose(SymbolName[j], 0, BarShift+1) - iClose(SymbolName[j], 0, BarShift)) / MarketInfo(SymbolName[j], MODE_POINT);
           if(iClose(Sym bolName[j], 0, BarShift) < iClose(SymbolName[j], 0, BarShift+1)&&iClose(SymbolName[j], 0, BarShift+1) >= iClose(SymbolName[j], 0, BarShift+2)) ExtMapBuffer1[i] +=(iClose(SymbolName[j], 0, BarShift) - iClose(SymbolName[j], 0, BarShift+1)) / MarketInfo(SymbolName[j], MODE_POINT); } } return(0); }// -------------------------------------------------------------------
waiting for help
 

Hi all.

Please comment on the beginning of the indicator in the new build. I'm interested in cycle start (how to do it correctly). Here is the code from BolingerBands. Comment the places with question //what does it mean and what is it for?

In the tutorial so far everything is the same old https://book.mql4.com/ru/samples/icustom

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 i,pos;
//---
   if(rates_total<=InpBandsPeriod || InpBandsPeriod<=0)    //что это значит ?
      return(0);
//--- counting from 0 to rates_total
   ArraySetAsSeries(ExtMovingBuffer,false);                //что это значит ?
   ArraySetAsSeries(ExtUpperBuffer,false);                 //что это значит ?
   ArraySetAsSeries(ExtLowerBuffer,false);                 //что это значит ?
   ArraySetAsSeries(ExtStdDevBuffer,false);                //что это значит ?
   ArraySetAsSeries(close,false);
//--- initial zero
   if(prev_calculated<1)                                  //что это значит ?
     {
      for(i=0; i<InpBandsPeriod; i++)                      //что это значит ?
        {
         ExtMovingBuffer[i]=EMPTY_VALUE;                   //что это значит ?
         ExtUpperBuffer[i]=EMPTY_VALUE;                    //что это значит ?
         ExtLowerBuffer[i]=EMPTY_VALUE;                    //что это значит ?
        }
     }
//--- starting calculation
   if(prev_calculated>1)                                   //что это значит ?
      pos=prev_calculated-1;                               //что это значит ?
   else                                                    //что это значит ?
      pos=0;//что это значит ?
//--- main cycle
   for(i=pos; i<rates_total && !IsStopped(); i++)          //что это значит ?
     {
      //--- 
      
      //код индикатора в цикле
      
      //---
     }
//---- OnCalculate done. Return new prev_calculated.
   return(rates_total);
  }
Reason: