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.
I wrote a simple script to open an order (from MQL4 tutorial).
int start() // Спец. функция start()
{ // Открытие BUYOrderSend(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.
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 // какого цвета будет первая линия //---- buffersdouble Buffer[];
externint 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);
}
//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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).
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.
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?
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.
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.
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
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
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
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