Download MetaTrader 5
To add comments, please log in or register
Do you know that MQL5 has structures?
ThreadHandle
105
ThreadHandle 2015.12.18 20:57 

The Normal syntax doesnt seem to register, does mql cater for multiple inheritance or do i have to work around it?

 I was attempting a partial MVC, well different adaptation but essentially wanted a controller class between MarketIndicator and Trader, they both inherit statistics class but for different reasons.

Should i just include both mqh files and create an instance of each?  

ThreadHandle
105
ThreadHandle 2015.12.18 23:30  
Also im guessing the Cbox's and dialogues dont work in strategy tester?  
whroeder1
13976
whroeder1 2015.12.19 01:29  
Keelan: The Normal syntax doesnt seem to register, does mql cater for multiple inheritance or do i have to work around it?
Inheritance - MQL4 Documentation Last line: MQL4 has no multiple inheritance
ThreadHandle
105
ThreadHandle 2015.12.19 10:23  

Yeh was just wondering if there was a work around but ive opted for static variables as the go between.

Never worked in C++ before, They seem to omit a fair chunk of the functionality, this due to simplicity or just their variation?

Also any idea why the downtime on the servers? I cant imagine they'd have any problem with latency or bandwidth. 

Ovo Cz
2987
Ovo Cz 2015.12.19 13:18  
Where did you encounter multiple inheritance if you never worked with C++?
ThreadHandle
105
ThreadHandle 2015.12.19 17:16  

Not sure maybe java had more than extends? i forget. I think c# you can inherit base class + shared interface. 

Plus since starting mql I've made a few steps towards learning c++.

ThreadHandle
105
ThreadHandle 2015.12.19 17:20  
Are chart events void on strategy testers? that would explain the lack of functionality of dialogues. 
JC
1399
JC 2015.12.19 18:32  
Keelan:

Not sure maybe java had more than extends? i forget. I think c# you can inherit base class + shared interface. 

(Not really relevant to this forum, but... the .NET languages don't have multiple inheritance in the full sense but a class can implement multiple interfaces, i.e. inherit from multiple abstract classes.)
Ovo Cz
2987
Ovo Cz 2015.12.19 22:38  
Keelan:

Not sure maybe java had more than extends? i forget. I think c# you can inherit base class + shared interface. 

Plus since starting mql I've made a few steps towards learning c++.

 

No, and interface is not inheritance.
ThreadHandle
105
ThreadHandle 2015.12.19 23:38  
Right you are...
Ovo Cz
2987
Ovo Cz 2015.12.20 06:29  
Keelan:
Right you are...

The work-around (or pattern from my point of view) which might be used is embedding the instance of the class into the instance of the other class type.

E.g. if you need Runnable instance for your logic, but your method is implemented in RunClass, create a wrapper (RunClassWrapper) and invoke your RunClass.operation() from within the RunClassWrapper.run() metod.

 

/ /12
To add comments, please log in or register