Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1382

 
Vladimir Karputov #:

You are using an ENUM_DEAL_REASON enumeration. You shouldn't compare enumeration element with any numbers, you should compare with enumeration elements. Here's an example, which accesses the trade history (though in OnTradeTransaction) and detects triggering of Stop Loss and Take Profit:

Example: tracking the triggering of Stop Loss or Take Profit

Thank you very much!
It really writes in the log when the stop is triggered. I can now experiment as I please.
Thank you.

 

I'm trying to call a virtual method from a class in the context of an inherited class, but I get an access to non-static member or function error. It goes like this:

class CParentClass
{
 public:
 virtual bool MyMethod(void);
 
 void Init(void);

};

void CParentClass::Init(void)
{
 CChildClass::MyMethod();
}



class CChildClass : public CParentClass
{
 public:
 virtual bool MyMethod(void);
};
In general, can I do this?
 
leonerd #:

I'm trying to call a virtual method from a class in the context of an inherited class, but I get an access to non-static member or function error. That's about it:

In general, can I do this?

Can't.

 
Could you please tell me why every time I test an EA on real ticks (timeframe and broker is the same) the mt5 terminal downloads the same data from the broker every time? Isn't mt5 supposed to download this data once and then download it from my computer?
 
aleksan2021 #:
Please advise, why in each test (timeframe and broker is the same) EA on real ticks mt5 terminal downloads the same data from the broker every time? Isn't mt5 supposed to download this data once and then download it from my computer?

How did you get to the claim that this happens every time? What is the reasoning behind it?

In fact, the ticks are loaded once, and in subsequent tests the ticks are only checked (synchronised) - which, by the way, is clearly visible if you look in the strategy tester's log.

 

Forum on Trading, Automated Trading Systems and Strategy Tests

FAQ from Beginners MQL5 MT5 MetaTrader 5

Vladimir Karputov, 2021.12.08 15:38

How did you get to the conclusion that it happens every time? What is the reason?

Actually, the ticks are loaded once, and in subsequent tests the ticks are only checked (synchronized) - which, by the way, is clearly visible if you look in the strategy tester's log.


It seems that indeed I confused synchronisation with downloading data from the broker. Can you tell me how to download the tick history from the file to mt5?

 
aleksan2021 #:

It seems that I have indeed confused synchronisation with uploading data from the broker. Can you tell me how I can download the tick history from a file to mt5?

WHY??? As soon as you connect to a trade server you have access to ALL the history on that trade server. Forget about the anachronism "download tick history".

 

Forum on Trading, Automated Trading Systems and Strategy Tests

FAQ from Beginners MQL5 MT5 MetaTrader 5

Vladimir Karputov, 2021.12.08 16:54

WHY? If you connect to a trade server, you have access to ALL the history on that trade server. Forget about the anachronism "download the tick history".

it's just that a broker that has a tick history does not support mt5
 
aleksan2021 #:
just a broker with a ticking history does not support mt5

If someone doesn't support MetaTrader 5 - run away from there as fast as you can!

 

Forum on Trading, Automated Trading Systems and Strategy Tests

FAQ from Beginners MQL5 MT5 MetaTrader 5

Vladimir Karputov, 2021.12.08 17:31

If someone does not support MetaTrader 5 - run away from there!


I'm not going to work with this broker, I need its history!

Reason: