You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
static CustomTick Ticks[1];
ExchangeTicks.DataSave(Ticks, true);
Error: 'Ticks' - parameter conversion not allowed
What can be done to solve this? When using the standard MqlTick is works fine.
(DataSave method see above code in class EXCHANGE_DATA)
since MQL does not have C pointers
remark:
I put "char symbol[8]" in place of "string symbol", because in functions like e.g. FileWriteArray() you can not use a struct that contains a string
regards
since MQL does not have C pointers
remark:
I put "char symbol[8]" in place of "string symbol", because in functions like e.g. FileWriteArray() you can not use a struct that contains a string
regards
Still parameter conversion error since ExchangeTicks.DataSave(Ticks, true);
expect Ticks of type MqlTick.
Still parameter conversion error since ExchangeTicks.DataSave(Ticks, true);
expect Ticks of type MqlTick.
Ok mea culpa, my post was more like "use C like programming, no OOP ", so I can not be of much help (as I can not read OOP). But in general, DataSave is a function you have made, so it expects whatever you have made it to expect. So, there may be a problem somewhere else, but as I have said I can not read OOP sorry :)
You can derive from a structure just fine. You can't use an array of the derived in place of an array of the base. You'll have to copy each element yourself.
The point is it's not coherent.
If you derive a structure from MqlRates (internal mql), you can pass it as an array in place of MqlRates in CopyRates, it compiles, but failed at runtime. It should not compile, as with any custom structure.
Passing a custom structure is not the problem, (the reference doesn't need adjusting since there's no multiple inheritance.) Passing an array of them is because there's no way to index the different sizes, and that should not compile.
Passing a custom structure is not the problem, (the reference doesn't need adjusting since there's no multiple inheritance.) Passing an array of them is because there's no way to index the different sizes, and that should not compile.
The point is it's not coherent.
If you derive a structure from MqlRates (internal mql), you can pass it as an array in place of MqlRates in CopyRates, it compiles, but failed at runtime. It should not compile, as with any custom structure.
I'm not sure what you guys are talking about... Passing a struct derived from MqlRates to CopyRates works just fine on my end. (MT4 build 1090)
Edit: Perhaps you forgot to add "public" to the declaration?I'm not sure what you guys are talking about... Passing a struct derived from MqlRates to CopyRates works just fine on my end. (MT4 build 1090)
Edit: Perhaps you forgot to add "public" to the declaration?A single structure as a reference is fine, while the array declaration relies on the structure length. In your example, the length does not change.
I'm not sure what you guys are talking about... Passing a struct derived from MqlRates to CopyRates works just fine on my end. (MT4 build 1090)
Edit: Perhaps you forgot to add "public" to the declaration?Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Новая версия платформы MetaTrader 5 build 1640: создание и тестирование собственных финансовых инструментов
fxsaber, 2017.10.17 13:47
CustomTickReplace не обладает прекрасной фичей MQL