From the best of my knowledge, both of these are used within mql4.
Question: Why would you choose one over the other and why?
This tutorial for C++ gives a good example for where you use both:
Obviously, the syntax is slightly different from MQL4.
The gist of the example is that all shapes have an area, but the area is calculated differently. So:
1. You create an interface and specify a virtual function getArea().
2. You derive all shape classes from this interface.
3. You override the getArea() function in each class.
The interface basically guarantees that you (as a programmer) don't forget to implement the getArea() function in each derived class.
That guarantee, i.e. the requirement to implement the getArea() function in each and every derived shape class, is why you use an interface. It keeps the naming consistent and forces you to implement.
You could easily extend this interface by adding getPerimeter(), since all shapes have a perimeter.
Thank you for your response. I have just started an online programming course. The course has shown me so far that a lot of things that I have be doing in any programming language are at times total nonsense. I have found that some of the codes I wrote years ago aren't "DRY". Some of them I have thought about re-writing or completely deleting them and starting over again.
Welcome to the discussion,
Maybe save a return value/s. Give the return back to the class/s. Then save return valves to file and retrieve them in order to assigned class.
Where did you think bool can equal a Trendline?
Secondly price can't really be true, or false.. can they!
Might be channel can be +- value & TrendLine can be another value....
Price can be up and down.