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

 
7777877:

1. What is a file pointer?

2. Why don't the end of line and the end of file coincide (when file pointer reaches the end of file)?

P.S. Not to clutter up the forum, thank you in advance for your answer

1. File pointer is actually a cursor when you type

2. Who told you that they should coincide? There's the '\n' string terminator and the 'EOF' file-end character; these are different characters. They are like the end of sentence character (full stop) and the end of paragraph character ("line break character"). First there is a full stop, which is the end of the line. Then comes the end of the paragraph.

 

Hello. There is a problem with writing an idnikator, basically there are two arrays for buffers,

Mass1

Mass2

And the data for each element of the array is counted in small numbers, that is, the values are 15, 27, 41, 14, etc.

If I set int type of arrays and if I run through each element I can see that the array values correspond to the calculated values, but if the type is Int then the indicator lines are not displayed in the window.

If I set the type of array double, the array stores more values I don't know where they come from, for example 21456545454, 43654534532, 24325235232 etc. Which do not correspond to the calculated values at all.

What could be the problem?

 

Hi all!

Help me out here.

I wrote a simple script to open an order (from MQL4 tutorial).

int start()                                  // Спец. функция start()
  {                                          // Открытие BUY
   OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
   Alert (GetLastError());
   return;                                   // Выход из start()
  }

In this example the code is given for instruments with 4 digits.

I have an account with a company that has 5 digits after the dot.

Can you please modify code for 5 digits and why error 4109 (trading not allowed) is displayed when script runs.

 
sss2019: If I set the type of arrays int, and if I run through each element, I can see that the array values match the calculated values, but if the type is Int, the indicator lines are not displayed in the window.

If I set the array type double, the array stores more values that I don't know where they come from, e.g. 21456545454, 43654534532, 24325235232, etc. Which do not correspond to the calculated values at all.

What can be the problem?

You have to appeal to telepaths. But it is quite possible that the problem is an inconsistency when dividing real numbers by integers.
 

Hello, can you please help me deal with the indicator. The idea is, with the opening of the American session at 16:00 Moscow timeframe a mark is placed above the candle, on any timeframe. I have problems with the datetime functions, I have read the tutorial more than once, looked at other indicators, but still do not understand.

Files:
exfbtix.mq4  2 kb
 
Yulia:

Hello, can you please help me deal with the indicator. The idea is, with the opening of the American session at 16:00 Moscow timeframe a mark is placed above the candle, on any timeframe. I have problems with the datetime functions, I have read the tutorial more than once, looked at other indicators, but still do not understand.


#property indicator_chart_window // указываем, что идикатор будет рисоваться в окне, где рисуется график валютной пары
#property indicator_buffers 1 // сколько линий будет рисовать наш индикатор
#property indicator_color1 Lime // какого цвета будет первая линия 
//---- buffers
double Buffer[];

extern int hour =9;

//+------------------------------------------------------------------+
int init()
{
  SetIndexStyle(0,DRAW_ARROW);
  SetIndexArrow(0,108);
  SetIndexBuffer(0,Buffer);  
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
int start()
{

int counted_bars=IndicatorCounted(); // сколько баров уже просчитано для начего индикатора
if(counted_bars<0) return(-1);// проверяем ошибки


int i=0;
    while(i<Bars)
         {
         if(TimeHour(Time[i])==hour)
            {        
            Buffer[i]=High[i]+150*Point;
            }
         
         i++;
         }

return(0);
}
//+------------------------------------------------------------------+

 
 
Thanks very much, but a little wrong, I only need a mark on the first candle on M1,M5 etc, except of course the daily and above.
 
Reshetov:
You will have to consult a telepath. But it's quite possible that the problem is an inconsistency in dividing real numbers by integers.


Here's the code

int lowsum, highsum;
int Mass1[];
int Mass2[];

                        while(start1 < end1 + 1)
                                {
                                lowsum = lowsum + iVolume(Symbol(), PERIOD_M1, start1);
                                start1++;
                                }
                        while(start2 < end2 + 1)
                                {
                                highsum = highsum + iVolume(Symbol(), PERIOD_M1, start2);
                                start2++;
                                }
                        Mass[i] = lowsum;
                        Mass[i] = highsum;
                        Alert(Mass[i], " ", highsum);

As a result, the alert outputs these messages:

You can see that the variable has a value, but you can't assign a variable value to an array, I can't figure out what the problem is

 
Yulia:
Thank you very much, but a little wrong, I only need a mark on the first candle on M1,M5 etc., except of course the daily and above.

As you had it, so it remains
 
sss2019:

You can see that the variable has a value, but you can't assign a variable value to an array, I can't figure out what the problem is

What is the size of the array?
Reason: