Major code conserns. Need some help here man!

 
Hello there!
I have a major problem and I need some help here. I'd be grateful if you help me figure a couple of things out. 
Please don't judge. 

1. what is a virtual function and when does one really need to use it?
I have gone through mql reference book but it kinda repeats the question itself. 
It says: "•virtual – applies only to class methods (but not to methods of structures) and tells the compiler that this method should be placed in the table of virtual functions of the class."
what's the point in explaining a virtual function using 'virtual' itself? For guys like me who mql is our first language, we can only hope that the reference book can become more helpful that it already is. But again, we have a community!

2. What and how can I learn how to use the ArrayLibraries in metaeditor? 
I'm trying to figure out a couple of things, most of which require matrix computations and the ArrayDouble, ArrayInteger and such like stuff keep popping up. Please suggest some materials that can help me understand this issue better.

3. I'm a couple of months into trading and coding, but since I'm a kind of guy who thinks out of the box, I have a couple of systems that have proven being profitable, and would like to enhance their features in terms of self-optimization, rather than hard-coding the inputs. Subsequently, I have started a research on Neural Networks and DNN. There's a public project called Ultimate_AI that is dedicated just for that. I'm new to public projects. Someone please explain how it works. By the way, feel free to join.

4. Is it practical to use OpenCL to enhance my Neural Networks project? Has anyone tried this before?
I'd love to channel the Neural computations to the GPU to improve on speed of learning. Some update calculations will be conducted at runtime, so I'd love to hear your opinion about this. 

5. While conducting my testing on a couple of codes, I usually encounter warnings in the terminal about leaked memory. I definitely fix the issues, but I'd like to know if the memory is recovered on its own or if I need to do something manually to recover it. I still don't clearly understand why some objects fail to get deleted from memory when the destructor is called. Some insight on this will be appreciated. 
#define prt Print
prt("Thanks in advance");
 
Nelson Wanyama:
Hello there!
I have a major problem and I need some help here. I'd be grateful if you help me figure a couple of things out. 
Please don't judge. 

1. what is a virtual function and when does one really need to use it?
I have gone through mql reference book but it kinda repeats the question itself. 
It says: "•virtual – applies only to class methods (but not to methods of structures) and tells the compiler that this method should be placed in the table of virtual functions of the class."
what's the point in explaining a virtual function using 'virtual' itself? For guys like me who mql is our first language, we can only hope that the reference book can become more helpful that it already is. But again, we have a community!

2. What and how can I learn how to use the ArrayLibraries in metaeditor? 
I'm trying to figure out a couple of things, most of which require matrix computations and the ArrayDouble, ArrayInteger and such like stuff keep popping up. Please suggest some materials that can help me understand this issue better.

3. I'm a couple of months into trading and coding, but since I'm a kind of guy who thinks out of the box, I have a couple of systems that have proven being profitable, and would like to enhance their features in terms of self-optimization, rather than hard-coding the inputs. Subsequently, I have started a research on Neural Networks and DNN. There's a public project called Ultimate_AI that is dedicated just for that. I'm new to public projects. Someone please explain how it works. By the way, feel free to join.

4. Is it practical to use OpenCL to enhance my Neural Networks project? Has anyone tried this before?
I'd love to channel the Neural computations to the GPU to improve on speed of learning. Some update calculations will be conducted at runtime, so I'd love to hear your opinion about this. 

5. While conducting my testing on a couple of codes, I usually encounter warnings in the terminal about leaked memory. I definitely fix the issues, but I'd like to know if the memory is recovered on its own or if I need to do something manually to recover it. I still don't clearly understand why some objects fail to get deleted from memory when the destructor is called. Some insight on this will be appreciated. 

Thank you all for having me. Having received no answers on my posed questions, I went over to amazon and purchased a c++ guide and figured out a couple of things by myself. I'll try to answer these questions, but anyone is free to chip in some info I might have missed during my brief and urgent search. 


1. Virtual functions. 

These types of functions are usually preceded by  the term 'virtual', and are used when overwriting a function in a class. Say, we have a function that calculates mass in our base class, but we would like to add optional height in the function without altering the contents of the base class. A virtual function may be used. Functions declared as virtual in the base class are virtual by default in all derived classes. 


2. Go through script examples that are provided when installing the terminal. They don't explain much, but can be helpful to someone with sufficient understanding of code. 


3. Being a Mathematics major student, I understand Math concepts very easily. A couple of YouTube videos on how NN are being applied out there provided a good start, including coding videos, although they were mostly coded in python. I believe that C++ is a quite sufficient language and can be used to code Machine Learning algorithms, provided one has sufficient knowledge, creativity and will. I'm well on my way with custom libraries almost ready, thanks to all contributors of many informative articles and documents on the forum.


4. It is. OpenCL can be used to speed up computational capabilities of a program since it paves way for multi-threaded matrix multiplication and a lot more other features. OpenCL language is not far from MQL and any willing person can tap their much needed computation power to speed up the operations of their programs. 


5. Custom types require additional care to ensure that default constructors and destructors are carefully assigned. The compiler only assigns constructors and destructors in cases where they are not explicitly defined. (More research on how to avoid them is underway.  I only know that they occurred due to erratic  use of object pointers.)


I hope it helps a learner somewhere. Feel free to contribute. Peace!

 

Sorry to write a comment here that is not directly related to the forum subject.

I am also very new into trading and saw some EA that need some modification on the code to make it more profitable. One way i saw that i can improve is on probability issue. There is always ups and downs on trading and i need somewhat my EA to switch startegy which i also need to encode later on. But the way it switches is by counting the orders closed in the profit history like every (nth number) for the currency pair. This EA will only trade one at a time, so the orders in the order history for each pair will not be that difficult to count. If like for example i want to count every 7 trades and after 7th trade number of wins are more than number of loss (4wins 3losses) then use current or continues trading with the current strategy, then will continue to count the next 7 currency pair trades (8th-14th) then if number of wins is now less (2wins 5losses) then it will switch strategy but will continue to count the order history from where it last stop like 15th-21st, if wins are more the continue and continue to count next 7 closed trades until there more losses again like if for the (29th-35th) there are (3wins 4losses) then it goes back to the first strategy but the first strategy will have to start counting on the last order for the next 7 close trades again.

I badly need to know how to encode this or do you have a source code for this?

Hope you respect this post. Thanks!!

forex news - Trading blogs and financial markets analysis
forex news - Trading blogs and financial markets analysis
  • www.mql5.com
Forex – foreign exchange market, or currency market – is the market where one currency is traded for another. Open 24-hours a day from Sunday evening through to Friday night, it is the world's most
 
Melbin78:

Sorry to write a comment here that is not directly related to the forum subject.

I am also very new into trading and saw some EA that need some modification on the code to make it more profitable. One way i saw that i can improve is on probability issue. There is always ups and downs on trading and i need somewhat my EA to switch startegy which i also need to encode later on. But the way it switches is by counting the orders closed in the profit history like every (nth number) for the currency pair. This EA will only trade one at a time, so the orders in the order history for each pair will not be that difficult to count. If like for example i want to count every 7 trades and after 7th trade number of wins are more than number of loss (4wins 3losses) then use current or continues trading with the current strategy, then will continue to count the next 7 currency pair trades (8th-14th) then if number of wins is now less (2wins 5losses) then it will switch strategy but will continue to count the order history from where it last stop like 15th-21st, if wins are more the continue and continue to count next 7 closed trades until there more losses again like if for the (29th-35th) there are (3wins 4losses) then it goes back to the first strategy but the first strategy will have to start counting on the last order for the next 7 close trades again.

I badly need to know how to encode this or do you have a source code for this?

Hope you respect this post. Thanks!!

That's your idea man. It's impossible that I'd have a source of an idea I've never seen. If you are a programmer, you can code the idea then ask for help here. Not ask for a source. Then, encoding is different from coding. :) 

You can create a public project on MetaEditor then update me. I might be interested and join. 

 
Melbin78: Sorry to write a comment here that is not directly related to the forum subject.
  1. Then don't. Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.
  2. Get history for the symbol/strategy, sort it, count it, decide. Use a different Magic number for each strategy, e.g. enum Strategy {…}; … MN=MNbase+strategy.
  3. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

 
Melbin78:

Sorry to write a comment here that is not directly related to the forum subject.

I am also very new into trading and saw some EA that need some modification on the code to make it more profitable. One way i saw that i can improve is on probability issue. There is always ups and downs on trading and i need somewhat my EA to switch startegy which i also need to encode later on. But the way it switches is by counting the orders closed in the profit history like every (nth number) for the currency pair. This EA will only trade one at a time, so the orders in the order history for each pair will not be that difficult to count. If like for example i want to count every 7 trades and after 7th trade number of wins are more than number of loss (4wins 3losses) then use current or continues trading with the current strategy, then will continue to count the next 7 currency pair trades (8th-14th) then if number of wins is now less (2wins 5losses) then it will switch strategy but will continue to count the order history from where it last stop like 15th-21st, if wins are more the continue and continue to count next 7 closed trades until there more losses again like if for the (29th-35th) there are (3wins 4losses) then it goes back to the first strategy but the first strategy will have to start counting on the last order for the next 7 close trades again.

I badly need to know how to encode this or do you have a source code for this?

Hope you respect this post. Thanks!!

No we don't respect this post ! That's incredible. Start to respect the user who created this topic if you want respect yourself, you are off-topic.
 
Nelson Wanyama:

Thank you all for having me. Having received no answers on my posed questions, I went over to amazon and purchased a c++ guide and figured out a couple of things by myself. I'll try to answer these questions, but anyone is free to chip in some info I might have missed during my brief and urgent search. 


1. Virtual functions. 

These types of functions are usually preceded by  the term 'virtual', and are used when overwriting a function in a class. Say, we have a function that calculates mass in our base class, but we would like to add optional height in the function without altering the contents of the base class. A virtual function may be used. Functions declared as virtual in the base class are virtual by default in all derived classes. 


2. Go through script examples that are provided when installing the terminal. They don't explain much, but can be helpful to someone with sufficient understanding of code. 


3. Being a Mathematics major student, I understand Math concepts very easily. A couple of YouTube videos on how NN are being applied out there provided a good start, including coding videos, although they were mostly coded in python. I believe that C++ is a quite sufficient language and can be used to code Machine Learning algorithms, provided one has sufficient knowledge, creativity and will. I'm well on my way with custom libraries almost ready, thanks to all contributors of many informative articles and documents on the forum.


4. It is. OpenCL can be used to speed up computational capabilities of a program since it paves way for multi-threaded matrix multiplication and a lot more other features. OpenCL language is not far from MQL and any willing person can tap their much needed computation power to speed up the operations of their programs. 


5. Custom types require additional care to ensure that default constructors and destructors are carefully assigned. The compiler only assigns constructors and destructors in cases where they are not explicitly defined. (More research on how to avoid them is underway.  I only know that they occurred due to erratic  use of object pointers.)


I hope it helps a learner somewhere. Feel free to contribute. Peace!

If you want answer, I think you should not post so much different unrelated questions. Also you need to be more specific.

I read your initial post and don't even know where to start, that's just to much. I would suggest you to create 1 topic for each point and ask specific questions which will show the efforts you made to find an answer by yourself without success.

And you title is not good, the title of a topic should always talk about the content. And beside that there are also woman on this site, and every where. don't start to be offending by excluding them by advance.

 
Alain Verleyen:

If you want answer, I think you should not post so much different unrelated questions. Also you need to be more specific.

I read your initial post and don't even know where to start, that's just to much. I would suggest you to create 1 topic for each point and ask specific questions which will show the efforts you made to find an answer by yourself without success.

And you title is not good, the title of a topic should always talk about the content. And beside that there are also woman on this site, and every where. don't start to be offending by excluding them by advance.

Okay. Thank you for the heads-up.

 

Hi, I am newbie here. Know little of your advanced users forum etiquette. The tone of some replies is appalling. The original poster is a mathematician not a frequent poster here.

Alain, This is just plain rude. " And beside that there are also woman on this site, and every where. don't start to be offending by excluding them by advance. " I did a search for "He and She" the original poster does not use them. So you Alain are way off topic.

 
David_NZ:

Hi, I am newbie here. Know little of your advanced users forum etiquette. The tone of some replies is appalling. The original poster is a mathematician not a frequent poster here.

Alain, This is just plain rude. " And beside that there are also woman on this site, and every where. don't start to be offending by excluding them by advance. " I did a search for "He and She" the original poster does not use them. So you Alain are way off topic.

Please don't bring up year old topics for no good reason. 

Complaining about users' tone is not a good reason.

You may have looked for he or she, but you failed to notice "man" in the title!

Reason: