I apologise for duplicating a question, but I can't do the following examples until I get this sorted out.
Please help me to figure it out.
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()
}
I coded it for 4 digits instruments.
I have an account with a company that has 5 digits after the dot.
Please advise how to correct code for 5 digits and why error 4109 (trading not allowed) is displayed when script runs?
I apologise for duplicating a question, but I can't do the following examples until I get this sorted out.
Please help me to figure it out.
I wrote a simple script to open an order (from MQL4 tutorial).
I coded it for 4 digits instruments.
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) appears when running script?
int start() // Спец. функция start()
{ // Открытие BUYOrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-150*Point,Bid+150*Point);
Alert (GetLastError());
return; // Выход из start()
}
Except that it doesn't have to work at all. You need to check stop and take sizes for validity by your brokerage company
ERR_TRADE_NOT_ALLOWED
4109
Trade is not allowed. You need to enable the "Allow EA to trade" option in the EA properties.
Apologies if this question has been raised before, but I have to go through 540 pages.
This is the problem. In MT4, the orders with the same price overlap and only one order is visible. Are there any settings in MT4 so that, for example, two orders on the chart are displayed side by side without overlapping each other. If there are no such settings, is it possible to create a table or a chart with such a function?
Apologies if this question has been raised before, but I have to go through 540 pages.
This is the problem. In MT4, the orders with the same price overlap and only one order is visible. Are there any settings in MT4 so that, for example, two orders on a chart are displayed side by side without overlapping each other. If there are no such settings, is it possible to create a table or a chart with such a function?
Ctrl+t and a table of all open positions appears at the bottom if you switch to the "Trade" tab.
Good afternoon... Question about FileIsEnding and FileIsLineEnding functions. In order to understand how FileIsEnding and FileIsLineEnding functions work, I wrote the following script:
After a number is written to the file, if you look in hexadecimal form, there will be the following entry
00000000: 31 2E 33 35 38 34 0D 0A | | 1.3584...
Each letter or number takes 1 byte or 8 bits, the last two characters are called line feed and carriage return, they are appended automatically so the file size is 8 bytes not 6.
Run your slightly modified script and notice how the cursor moves (deliberately made the enumeration larger than the file size, so you can see where the error occurs.
int start() //функция start
{ //начало startdouble Timestart=GetTickCount(); //переменная, с помощью которой вычисляется время (в милисекундах) начала выполнения эксперта string name="Копия Запись чисел в файл.csv"; //имя создаваемого файлаbool h; //переменная: значение функции FileIsEndingbool h_l; //переменная: значение функции FileIsLineEndingint error; //переменная: ошибкаint handle=FileOpen(name,FILE_CSV|FILE_WRITE,';'); //открываем заданный файл n записываем туда данныеint запись=FileWrite(handle,DoubleToStr(1.3584,4)); //записываем цены OHLC в файл csv (в преобразованном виде, т.е в виде текста)FileClose(handle); //закрываем файл//---------------------------------------------------------------------------------------- 2 -
handle=FileOpen(name,FILE_CSV|FILE_READ,';'); //открываем заданный файлint size=FileSize(handle); //вычисляем размер заданного файлаPrint("Размер файла ",name," составил ",size," байт");
for(int i=0;i<=size;i++)
{
GetLastError();
bool pos=FileSeek(handle,i,SEEK_SET); //смещаем от начала вправо указатель файлаint pos1=FileTell(handle);
double чтение=FileReadNumber(handle); //считываем число из текущей позиции (уже измененной функцией FileSeek) файлового указателя
h=FileIsEnding(handle); //устанавливаем текущее значение переменной h
h_l=FileIsLineEnding(handle); //устанавливаем текущее значение переменной h_l
error=GetLastError(); //значение ошибки, производимой функцией FileIsEndingif(error!=0)Alert("Текущая ошибка ",error); //если код текущей ошибки не равен 0, то получаем номер текущей ошибки//----------------------------------------------------------------------------------------- 3 -Print(" Функция FileSeek вернула: ",pos,
" Указатель находится в позиции - ",pos1,
" Функция FileReadNumber(handle) вернула: ",чтение);//печать сообщения
}
FileClose(handle); //закрываем файл//----------------------------------------------------------------------------------------- 4 -return(0); //выход из start
} //конец start//-------------------------------------- КОНЕЦ START -------------------------------------- 5 -
When debugging the indicator, you need to print out an array of price and time values from certain bars on the shifft.
price1 = iMA(Symbol(),i_maTF,i_maPeriod,i_maShiftByPrice,i_maMethod,i_maPrice,i_shiftBarsBack1+i); // Цена в точке А
price2 = iMA(Symbol(),i_maTF,i_maPeriod,i_maShiftByPrice,i_maMethod,i_maPrice,i_shiftBarsBack2+i); // Цена в точке В
time1 = iTime(Symbol(),Period(),i_shiftBarsBack1 + i - 1); // Время в точке А
time2 = iTime(Symbol(),Period(),i_shiftBarsBack2 + i - 1); // Время в точке В
I get all this inside the operator, of course:
for(i = limit - 1;i > 0;i--)
Then, I transfer the price and time values to arrays in order to work with them further:
varsPrice1[i] = price1; // Массив цен в точке А
varsPrice2[i] = price2; // Массив цен в точке В
varsTime1[i] = time1; // Массив времени в точке А
varsTime2[i] = time2; // Массив времени в точке В
I try to print out what I already have immediately afterwards:
Here we can clearly see that price values of both varsTime1[i] andvarsTime2[i] and just prices from time1 andtime2 are always 0. What's wrong with that?
Hi forum users!!!! Guys, I have a question - who knows in what file are stored scripts assigned to "hotkeys"? I want to save this file with the appointed already "Hotkeys" that every time after reinstallation of the terminal if suddenly there is such a need, not to assign these keys again ... but only file copied and all ... Thank you all in advance.
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.
I apologise for duplicating a question, but I can't do the following examples until I get this sorted out.
Please help me to figure it out.
I wrote a simple script to open an order (from MQL4 tutorial).
I coded it for 4 digits instruments.
I have an account with a company that has 5 digits after the dot.
Please advise how to correct code for 5 digits and why error 4109 (trading not allowed) is displayed when script runs?
I apologise for duplicating a question, but I can't do the following examples until I get this sorted out.
Please help me to figure it out.
I wrote a simple script to open an order (from MQL4 tutorial).
I coded it for 4 digits instruments.
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) appears when running script?
Except that it doesn't have to work at all. You need to check stop and take sizes for validity by your brokerage company
Except that it doesn't necessarily work. We need to check stop and take sizes to see if they are allowed by your brokerage company's stopwatch
Thank you very much!
Needed to allow EA to trade)
Good day to all.
Apologies if this question has been raised before, but I have to go through 540 pages.
This is the problem. In MT4, the orders with the same price overlap and only one order is visible. Are there any settings in MT4 so that, for example, two orders on the chart are displayed side by side without overlapping each other. If there are no such settings, is it possible to create a table or a chart with such a function?
Good day to all.
Apologies if this question has been raised before, but I have to go through 540 pages.
This is the problem. In MT4, the orders with the same price overlap and only one order is visible. Are there any settings in MT4 so that, for example, two orders on a chart are displayed side by side without overlapping each other. If there are no such settings, is it possible to create a table or a chart with such a function?
Please help me out - I'm writing an EA - I've used code as a substrate;
if(drawBacker){
for(int x=0;x<7;x++)
for(int y=0;y<29;y++)
{
ObjectCreate("A_Fon "+x+y,OBJ_LABEL,0,0,0,0);
ObjectSet("A_Fon "+x+y, OBJPROP_CORNER, positionWindow); // positionWindow // Txt_Location
ObjectSet("A_Fon "+x+y,OBJPROP_XDISTANCE,x*20+5);
ObjectSet("A_Fon "+x+y,OBJPROP_YDISTANCE,y*20+9);
ObjectSetText("A_Fon "+x+y,CharToStr(110),26, "Wingdings",colorSubstrate);//Red);
}
if (drawWingdings==False)
{
for( int posp=1000;posp>0;posp--)
{
ObjectDelete("A_Fon "+posp);
ObjectDelete("A_Fon0"+pospp);
ObjectDelete("A_Fon00");
}
}
}
As a result, I've got a mess, as a huge number of objects are drawn on the chart.
Please tell me the normal code to set the background of the text.
Good afternoon... Question about FileIsEnding and FileIsLineEnding functions. In order to understand how FileIsEnding and FileIsLineEnding functions work, I wrote the following script:
After a number is written to the file, if you look in hexadecimal form, there will be the following entry
00000000: 31 2E 33 35 38 34 0D 0A | | 1.3584...
Each letter or number takes 1 byte or 8 bits, the last two characters are called line feed and carriage return, they are appended automatically so the file size is 8 bytes not 6.
Run your slightly modified script and notice how the cursor moves (deliberately made the enumeration larger than the file size, so you can see where the error occurs.
When debugging the indicator, you need to print out an array of price and time values from certain bars on the shifft.
I get all this inside the operator, of course:
Then, I transfer the price and time values to arrays in order to work with them further:
I try to print out what I already have immediately afterwards:
This is what is printed in the Expert Log:
Here we can clearly see that price values of both varsTime1[i] andvarsTime2[i] and just prices from time1 andtime2 are always 0. What's wrong with that?
You should give us the whole code. You don't want to guess what is clear to you.
I understand that I don't want to guess, but can you at least give me a hint, if the problem is clear to you?
Guys, I have a question - who knows in what file are stored scripts assigned to "hotkeys"? I want to save this file with the appointed already "Hotkeys" that every time after reinstallation of the terminal if suddenly there is such a need, not to assign these keys again ... but only file copied and all ...
Thank you all in advance.