Fake OrderSend from an EA does not always allow you to determine its settings.
The code I provided shows the settings of any EA, regardless of symbol properties and others. For example, run an EA of some kind and then this script on the same chart
// Скрипт показывает, в каком режиме Long/Short запущен советник на данном чарте.voidOnStart()
{
Alert(LongShortToString());
}
Fake OrderSend from an EA does not always reveal its settings.
The code I provided shows the settings of any EA, regardless of symbol properties and others. For example, run an EA of some kind and then this script on the same chart
1. in the discussion https://www.mql5.com/ru/forum/214590/page6#comment_11947599
the code should be replaced with return(INIT_SUCCEEDED); - I tried it and did not understand where the EA was missing ))
2. I do not understand why, when I select EA properties and put a different checkbox, the alert does not reappear, when I switch TFs, everything is normal
Fake OrderSend from an EA does not always reveal its settings.
The code I provided shows the settings of any EA, regardless of symbol properties and others. For example, run an EA of some kind and then this script on the same chart
is it possible to add your code to the EA?
int testTicket=OrderSend(Symbol(),OP_SELL,0.01,0,3,0,0,"Sell Try",1,0,CLR_NONE);
if (GetLastError() == 4111) testLONG_SHORT="Long Only Mode";
testTicket=OrderSend(Symbol(),OP_BUY,0.01,0,3,0,0,"Buy Try",1,0,CLR_NONE);
if (GetLastError() == 4110) testLONG_SHORT="Short Only Mode";
With this code it endlessly opens long and short orders on xauusd
int testTicket=OrderSend(Symbol(),OP_SELL,0.01,0,3,0,0,"Sell Try",1,0,CLR_NONE);
if (GetLastError() == 4111) testLONG_SHORT="Long Only Mode";
testTicket=OrderSend(Symbol(),OP_BUY,0.01,0,3,0,0,"Buy Try",1,0,CLR_NONE);
if (GetLastError() == 4110) testLONG_SHORT="Short Only Mode";
With this code it endlessly opens long and short orders on xauusd
The idea here is that you need exactly zero volumes.
The idea here is that you need exactly zero volumes.
It opens 0.01 lots without volume.
int testTicket=OrderSend(Symbol(),OP_SELL,0,0,3,0,0,"Sell Try",1,0,CLR_NONE);
if (GetLastError() == 4111) testLONG_SHORT="Long Only Mode";
testTicket=OrderSend(Symbol(),OP_BUY,0,0,3,0,0,"Buy Try",1,0,CLR_NONE);
if (GetLastError() == 4110) testLONG_SHORT="Short Only Mode";
and that doesn't work at all.
int testTicket=OrderSend(Symbol(),OP_SELL,0,0,0,0,0,"Sell Try",1,0,CLR_NONE);
if (GetLastError() == 4111) testLONG_SHORT="Long Only Mode";
testTicket=OrderSend(Symbol(),OP_BUY,0,0,0,0,0,"Buy Try",1,0,CLR_NONE);
if (GetLastError() == 4110) testLONG_SHORT="Short Only Mode";
1. in the discussion at https://www.mql5.com/ru/forum/214590/page6#comment_11947599
I should replace the code with return(INIT_SUCCEEDED); - I tried it and did not understand where the Expert Advisor was missing ))
I purposely put FAILED in this example, so that I would not need to remove it manually later.
2. I do not understand why, when I select EA properties and put a different checkbox, the alert does not reappear, when I switch TFs, everything is normal
When changing Long/Short there is no OnDeinit/OnInit call.
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.
What am I doing wrong? On m5 it switches fine, but not further
I have not found any trading tools like the dollar index, etc. (indicators?)
they are not allowed to trade on them, how will your code behave?
I have not found any trading tools like the dollar index, etc. (indicators?)
trading on them is forbidden, how will your code behave?
Fake OrderSend from an EA does not always allow you to determine its settings.
The code I provided shows the settings of any EA, regardless of symbol properties and others. For example, run an EA of some kind and then this script on the same chart
Fake OrderSend from an EA does not always reveal its settings.
The code I provided shows the settings of any EA, regardless of symbol properties and others. For example, run an EA of some kind and then this script on the same chart
checked, it works, but
1. in the discussion https://www.mql5.com/ru/forum/214590/page6#comment_11947599
the code should be replaced with return(INIT_SUCCEEDED); - I tried it and did not understand where the EA was missing ))
2. I do not understand why, when I select EA properties and put a different checkbox, the alert does not reappear, when I switch TFs, everything is normal
Fake OrderSend from an EA does not always reveal its settings.
The code I provided shows the settings of any EA, regardless of symbol properties and others. For example, run an EA of some kind and then this script on the same chart
is it possible to add your code to the EA?
With this code it endlessly opens long and short orders on xauusd
Can I add your code to my EA?
Yes.
Forum on trading, automated trading systems & strategy testing
Any MQL4 and MQL5 beginners questions, help and discussion on algorithms and codes
Lomonosov1991, 2019.06.04 19:01
With this code it endlessly opens long and short orders on xauusd
Yes.
and that doesn't work at all.
checked, it works, but
1. in the discussion at https://www.mql5.com/ru/forum/214590/page6#comment_11947599
I should replace the code with return(INIT_SUCCEEDED); - I tried it and did not understand where the Expert Advisor was missing ))
I purposely put FAILED in this example, so that I would not need to remove it manually later.
2. I do not understand why, when I select EA properties and put a different checkbox, the alert does not reappear, when I switch TFs, everything is normal
When changing Long/Short there is no OnDeinit/OnInit call.
No OnDeinit/OnInit call when changing Long/Short.
strange behavior, normally OnIniT() is executed after the settings window is called.
I don't understand how to run it((
attached the sample, unzip it and scatter in folders