I have created my first EA, it works smoothly, but what should I do if I want to turn off the platform and the EA for a while, how can I make the EA work with the same values that were before it was turned on?
I have a question about calculating profits on futures and cfd, or rather to calculate the distance for a certain profit. i can't find how to calculate it correctly.
lotReset is the lot size, and lot is the contract size in the base currency of the instrument.
For forex, for example, I calculate it like this: dangerDistLoss =profit /( (0.00001 /point) *(lotReset * lot) * value);
borilunad: Why do they change when you turn them off/on?
I think that these variables are reset to zero when the platform is turned off and I want them to be saved, maybe I'm wrong and the EA keeps them until I remove it from the window, I haven't found anything about it in the MQL4 manual, maybe you can advise me which materials to read, thanks in advance.
amavladi: If I'm wrong, the Expert Advisor saves them until I remove it from the window, I haven't found anything about it in the MQL4 manual, may be you can advise what materials to read, thanks in advance.
How can you change external variables that you have written in representation as extern int, double, string or bool?
Hi all. I don't know how to do it right (if I did, I wouldn't ask). I will put it in a nutshell.
Imagine, on a demo account (EURUSD H1) there is a Moving Average (or another EA). We attach a single line indicator to the same chart:
Comment("OrdersTotal ",OrdersTotal()); During the EA operation and opening of trade and/or pending orders, the result of the indicator
(in the upper left corner) will be changed. Now, a question for the experts) I am doing the same in the strategy tester. The indicator's result is: the number of open orders in the terminal.
How can I see the open orders in the strategy tester (as a rule, they have ticket numbers 1, 2, 3, etc.) from the indicator? And the closed ones (tester history) ?
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.
save the variables to a file, then read them back
I have a question about calculating profits on futures and cfd, or rather to calculate the distance for a certain profit. i can't find how to calculate it correctly.
lotReset is the lot size, and lot is the contract size in the base currency of the instrument.
For forex, for example, I calculate it like this: dangerDistLoss =profit /( (0.00001 /point) *(lotReset * lot) * value);
Why do they change when you turn them off/on?
If I'm wrong, the Expert Advisor saves them until I remove it from the window, I haven't found anything about it in the MQL4 manual, may be you can advise what materials to read, thanks in advance.
Hi all. I don't know how to do it right (if I did, I wouldn't ask). I will put it in a nutshell.
Imagine, on a demo account (EURUSD H1) there is a Moving Average (or another EA). We attach a single line indicator to the same chart:
Comment("OrdersTotal ",OrdersTotal()); During the EA operation and opening of trade and/or pending orders, the result of the indicator
(in the upper left corner) will be changed. Now, a question for the experts) I am doing the same in the strategy tester. The indicator's result is: the number of open orders in the terminal.
How can I see the open orders in the strategy tester (as a rule, they have ticket numbers 1, 2, 3, etc.) from the indicator? And the closed ones (tester history) ?
How is it possible to change external variables that you have written in the view as extern int, double, string or bool?
Who knows how to find out
longchart_id, // Chart ID. 0 means current chart.
if the chart is not current?