Expert Advisor, script, indicator are not accessed, but work in the current window. And global variables of different windows/charts do not overlap. Therefore, it should work)
string AUDUSD; // This is a text variable, besides being initially empty, i.e. equal to ""
(Symbol() == AUDUSD) // this string has nothing to do with variable AUDUSD.
But the order opening criteria should not be the same for different instruments/windows. If they are the same, it will indeed open in all windows.
Thank you!
I implemented the logic so that the Expert Advisor would not get the signal to open orders when they open in several windows and would understand that the buy signal was given for such a symbol so the EA would not interfere with others.
The problem is not in the values of the variable in my opinion. I just have in my code uulsovii recalculation at the occurrence of a new hour. and it turns out that the current symbol new bar appears and calculated the value of bar = 1, but the signal symbol is a new bar has not yet been formed or what is the value for a bar = 2
The problem is solved easily - I just tracked the start of a new bar by the signal symbol
Is it possible to pass several switch case parameters from the function body? I have types of orders to be opened in switch case and I managed to pass only 1 parameter to open an order from the function defining market entry point, as I already understood it is impossible, so I don't know how to implement it even sequentially
Is it possible to pass several switch case parameters from the function body? I have types of orders to be opened in switch case and I managed to pass only 1 parameter to open an order from the function defining market entry point, as I already understood it is impossible, so I don't know how to implement it even sequentially yet
Please show me in the code what exactly you are interested in
Is it possible to pass several switch case parameters from the function body? I have types of orders to be opened in switch case and I have managed to pass only 1 parameter to open an order from the function defining market entry point, as I already understood it is impossible, so I don't know how to implement it even sequentially
int OpenOrder()
{
switch(AUDUSD_Analizing)
{
case0 : Alert("Нет условий для открытия ордера. Выход"); break;
case1 : // кейс для открытия Buy по AUD/USDif(TimeServer() == true)
{
if(Symbol() == AUDUSD)
{
RefreshRates();
Open_Order = OrderSend("AUDUSD",OP_BUY,lot,Ask,0,0,0);
Alert("Тикет открытого ордера ", Open_Order, GetLastError());
case2 : // кейс для открытия Sell по AUD/USDif(TimeServer() == true)
{
if(Symbol() == AUDUSD)
{
RefreshRates();
Open_Order = OrderSend("AUDUSD",OP_SELL,lot,Bid,0,0,0);
Alert("Тикет открытого ордера ", Open_Order, GetLastError());
//-------------------------------------------------------------------------------------------------------------// другая функция//-------------------------------------------------------------------------------------------------------------int AUDUSD_Analizing()
{
if(AUDUSD_Prices_new > AUDUSD_Prices_old)
{
s1 = AUDUSD_Prices1;
s2 = AUDUSD_Prices2;
s3 = s1 - s2;
if(raznica > s5)
{
Alert("--- ВРЕМЯ ОТКРЫВАТЬ ОРДЕР НА ПОКУПКУ ---");
и вот тут я могу либо прописать конкретное открытие ордера или несколько их штук(чем и решил заняться так
как не нашел решения), либо вернуть номер кейса в первую функцию(что сократило бы код).
Но мне нужно по условиям открывать сразу несколько сделок. К примеру нужно 2 на бай разом открыть,
а возвращается только одно значение и исполняется один кейс и дальше уже на новый круг все идет,
а мне нужно сразу несколько кейсов, допустим 5 выполнить, поставить 5 отложек и вот как передать не пойму,
или как вызвать срабатывание кейсов в последовательности. Если с кейсами можно как-то придумать, то по
факту код влезет в рамку 400-600 строк, а так полагаю все 1000+ выйдет в лучшем случае
(разбитые по 100-200 строк на .mqh, но и из файлов тоже помойка сложится)
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.
string AUDUSD = "AUDUSD";
At least like this.
That's it!!! That's how it was for me))), erased and forgotten))
Thank you so much!!! Peace in your home!
Expert Advisor, script, indicator are not accessed, but work in the current window. And global variables of different windows/charts do not overlap. Therefore, it should work)
string AUDUSD; // This is a text variable, besides being initially empty, i.e. equal to ""
(Symbol() == AUDUSD) // this string has nothing to do with variable AUDUSD.
But the order opening criteria should not be the same for different instruments/windows. If they are the same, it will indeed open in all windows.
Thank you!
I implemented the logic so that the Expert Advisor would not get the signal to open orders when they open in several windows and would understand that the buy signal was given for such a symbol so the EA would not interfere with others.
There it is!!! That's how it was for me))), erased and forgotten))
Thank you so much!!! Peace into your home!
Or like this on a global variable level
Or like this on global variable level
Actually it is cool)) Now the robot gets a signal and opens orders on different pairs in several windows at once))
Thanks again!
The problem is not in the values of the variable in my opinion. I just have in my code uulsovii recalculation at the occurrence of a new hour. and it turns out that the current symbol new bar appears and calculated the value of bar = 1, but the signal symbol is a new bar has not yet been formed or what is the value for a bar = 2
The problem is solved easily - I just tracked the start of a new bar by the signal symbol
Please advise.
Please show me in the code what exactly you are interested in
Please advise.
Are you referring to a range of values?
Show the code exactly what you are interested in
Do you mean a range of values?
No, for example pass case 1 first, then case 2, etc.
cases execute the opening of orders