Errors, bugs, questions - page 1634

 
fxsaber:
LifeHack: getting any number of visualisation windows.
Do a history debug from Metaeditor - CTRL+F5. Do not close the visualization window that appears, but close the terminal window. Then you start from the beginning. Thus, new windows of visualization will appear, which is useful during the analysis of changes of the EA results depending on the changes made in the code.

It could be simpler. To start the visualization with a forward.

The next visualization will be started on the second, forward, visualization

 
fxsaber:
I would like to see in Tester->Settings the option "Delete previous logs after Start". It is tiring to click "Delete logs" in Tester->Journal every time. Obviously, logs from previous backtests can be useful in rare cases. Most of the time they are not needed. Therefore, the option to automatically delete old logs would be useful both for convenience and to save space on HDD/SDD.
That's right."May come in handy in rare cases"
 
fxsaber:
How do I know if Hedge mode is on/off on the account/tester? There is no mention of this in the offline help.

Hover your mouse over the account in the navigator. You can see it in the account tooltip.

When you connect to the account the terminal log says netting or hedging

 

Previously on application #1534780 about leading constructor call where the result of attached code was

2016.08.10 16:39:26.982 Test (GBPUSD,M15) void A::~A():12855
2016.08.10 16:39:26.982 Test (GBPUSD,M15) OnDeinit:3
2016.08.10 16:39:26.975 Test (GBPUSD,M4) void A::A():17233
2016.08.10 16:39:15.587 Test (GBPUSD,M15) void A::A():12855

the answer (*) was as follows:

Support Team 2016.08.11 13:35

There is no leading call, when you change timeframe a new indicator is created (cloned), then the previous one is deleted


If so, then the following example shows a delayed constructor call

Sequence of actions:

  1. Open a new chart of GBPUSD,M15
  2. Change the timeframe to H1
  3. Attach the Test.ex5 indicator to the chart
  4. Change the chart period to M15

Result:

2016.08.11 15:51:51.188 Test (GBPUSD,M15) void A::A():17936
2016.08.11 15:51:50.932 Test (GBPUSD,H1) void A::~A():12285
2016.08.08.11 15:51:50.931 Test (GBPUSD,H1) OnDeinit:3
2016.08.11 15:51:39.421 Test (GBPUSD,H1) void A::A():12285

it should be (see *) - the underlined line should come 2nd (in time), not last

//Test.mq5
class A { public:
        A() : a( MathRand()) { Print( __FUNCSIG__, ":", a ); }
        virtual ~A()         { Print( __FUNCSIG__, ":", a ); }
        int a;
};
static A a;
void OnInit() {}
void OnDeinit( const int reason ) { Print( __FUNCTION__, ":", reason ); }
int OnCalculate( const int rates_total, const int, const int, const double& [] ) { return rates_total; }
 

Indicator calculation takes place in a separate symbol thread, setting the chart period and creating a clone takes place in a GUI thread

This is why a situation can occur when a new indicator is calculated before the previous one is deleted and vice versa.

Character flow operation (abstract)

  1. action #1
  2. action #2
  3. action #3 - calculation of indicators
  4. action #4
  5. action #5 - check and delete unused indicators
  6. action #6
  7. action #N
  8. skip to step 1 if not stopping the flow

Depending on which point the symbol stream was in, the sequence of initializing a new indicator and deleting the old one depends on it.

 
Slawa:
That's right."may come in handy on rare occasions".
So it's logical not to write gigabytes when the user specifically asks for it. You have to clean them manually anyway.
 
Slawa:

Hover your mouse over the bill in the navigator. You will see the account's tooltip.

After connecting to the account, the terminal log will show netting or hedging

How?
 
fxsaber:
Programmatically how?!
ENUM_ACCOUNT_MARGIN_MODE margin_mode=(ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
bool is_hedging=(margin_mode==ACCOUNT_MARGIN_MODE_RETAIL_HEDGING);
 
fxsaber:
How do I know if Hedge mode is on/off on the account/tester? The offline help doesn't say a word about it.

MQL5 Reference - Standard Constants, Enumerations and Structures - Environment State - Account Information - ENUM_ACCOUNT_MARGIN_MODE

MQL5 Reference Manual - Account Information - AccountInfoInteger - ENUM_ACCOUNT_INFO_INTEGER - ENUM_ACCOUNT_MARGIN_MODE

MQL5\Include\Trade.mqh - CTrade::IsHedging

 
Slawa:

MQL5 Reference - Standard Constants, Enumerations and Structures - Environment State - Account Information - ENUM_ACCOUNT_MARGIN_MODE

MQL5 Reference Manual - AccountInfoInteger - ENUM_ACCOUNT_INFO_INTEGER - ENUM_ACCOUNT_MARGIN_MODE

MQL5\Include\Trade.mqh - CTrade::IsHedging

Thank you! Sorry, I searched by the word Hedge.
Reason: