Forum

"Curiously recurring template pattern" & Casting in MQL5 - help needed

consider the following code: /* * Curiously recurring template pattern * In my use case the following inheritance tree was intended to work with Candlestick Patterns */ #include <Arrays\ArrayObj.mqh> // base class for all patterns template < typename Derived> class CBase: public CObject {

Bug in Examples/ZigZag Indicator

Just now the ZigZag in the example folders has a bug. It has a double High and a double Low. look at the attached screenshots Setting are: 24,10,6 on GBPUSD & 18,7,5 on EURCHF just me? regards daniel

[bug] return issue with structs!

Hello, this bug took me some days to catch. The same code executed from Onstart() works, but from a method or function does NOT. Here is the Script code: struct STest{ double a, b; void STest(): a( 0 ), b( 0 ) {} void STest( double A, double B): a(A)

is it posible to assign NaN to a variable of type double?

A variable of type double is alway set. Can I assign it to NaN? - MathIsValidNumber() returning false ? void OnStart () { double a; Print ( MathIsValidNumber (a), " " ,a); //-> "true 0.0" } doc Quote from: https://www.mql5.com/en/docs/basis/types/double "Besides the minus infinity there is the

Vector Graphics Library port to MQL, help needed!

Since the availability of CCanvas it is time for a Vector library. To do so, I tried to port parts of paperjs.org (The Swiss Army Knife of Vector Graphics Scripting) to MQL. Help is needed cause I can't fix the remaining issues myself. I guess that there will be an official library provided soon

(bug?) static struct::factory not working

While trying to realize factories within Structs I came across something that's possibly a Bug. It compiles fine, but a static Method seems to return the wrong thing... simplified example: struct Info { double a; double b; double c; Info() : a( 1.1 ), b( 2.2 ), c( 3.3 )

How to initializ structs in function calls??

Hi, is there a way to initialize a struct within a function call. Does it work only for classes? CClass c; SStruct s; // works with classes! c.Test( new CClass()); // error: '{' - parameter passed as reference, variable expected s.Test({ 1 , 2 }); // works, but it screams for a shortcut SStruct

How to duplicate objects like CObject???

Hi CObject *o1 = new CObject(); CObject *o2 = o1; o1 and o2 are now referring to the same object - that is the proper way, I'm not complaining. But how do I copy an Object? thank you

How to get my highest account balance?

Hi, for an custom Money management I would like to know the highest account balance . Is there a solution except from looping through the History Deals? thank you

My CSignalRandom isn't Random. Please Help Me - I know about MathSrand()

I'm developing a Random Signal and it looks like if this isn't as easy as I thought. the intention to allow some sort of variance even in the tester. But the problem is that every tester run is the same, no variance at all. Here is my code: int CSignalRandom::ShortCondition() { int result= 0 ;