| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| embedding class from an indicator in an expert. https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5732 |
Page 1 of 1 |
| Author: | dvirma [ Tue Aug 13, 2019 10:07 pm ] |
| Post subject: | embedding class from an indicator in an expert. |
hello steve, hello everyone, and regards. along with the gradual turn from mql4 to mql5 language, codes are becoming less and less understood, at least for the amateur coder. as new codes are published, some of them seems to be very professional in which plenty of thought were invested. for instance this volatility indicator, coded by mladen rakic. i tried to disintegrate the main class of the code and transform it into simple function which returns value by requested pair and timeframe, as seen in some of steve's codes, and which can be embeded easily in the shell ea. as for now i went lost with it. will someone take the challenge? https://www.mql5.com/en/code/26159 |
|
| Author: | tomele [ Tue Aug 13, 2019 10:54 pm ] |
| Post subject: | embedding class from an indicator in an expert. |
Why? MQL4 knows classes ... |
|
| Author: | dvirma [ Wed Aug 14, 2019 12:04 am ] |
| Post subject: | embedding class from an indicator in an expert. |
yes. the code itself is in mql4. the thing is that the form of classes isn't common in steve's codes. and i don't manage to merge it. how to call it? how many bars to count? how to inverse the index? how to refer symbol and timeframe to it? what we are used to is something like that: double getvolatility(string pair, int timeframe, int shift) {... ... return(volatility); } and here it works differently. |
|
| Author: | tomele [ Wed Aug 14, 2019 12:33 am ] |
| Post subject: | embedding class from an indicator in an expert. |
Nobody is interested in what you are used to. Fact is, it will work in Steve's (or any other) code exactly as in the code you attached. Define a class with constructor (for initialization), (optional) destructor and methods: Code: Select all Code: Select all Code: Select all Code: Select all Cheers |
|
| Author: | dvirma [ Wed Aug 14, 2019 12:54 am ] |
| Post subject: | embedding class from an indicator in an expert. |
thank you thomas. i will try to do that. i'm also trying to fill the gap and learn the class section in c++. |
|
| Author: | tomele [ Wed Aug 14, 2019 1:07 am ] |
| Post subject: | embedding class from an indicator in an expert. |
Glad to help. My approach always was to study working code and then look up everything in the language reference that I don't understand. You might try that for yourself. The MQ4 language reference is quite good. Cheers |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|