Comments (7)
Something like [1] ? It provides some glue for MQL5's missing functions, I did test it with a simple script and it works just fine and moth MQL{4,5} found no syntax errors.
from ea31337-classes.
@LemonBoy Sorry for a late reply. Yes, however I expect those methods wrapped in the class, so I could call the methods consistently from the other file without having worrying about #ifdef
outside of the class or in which version the main MQL file is compiled. In other words I just want to call DateTime::Day()
(or by class instance) from both MQL4/MQL5 file and I expect the same result.
For example the code structure should be:
class DateTime {
int Day() {
#ifdef __MQL5__
MqlDateTime dt;
TimeCurrent(dt);
return(dt.day);
#else
return Day();
#endif
}
// ... more methods
}
where the methods are replication of MQL4 functions and at the same time they're compatible with MQL5 as well. In DateTime
class just use only the function related to date time (so the rest non-relevant part can be removed). This is just initial idea, once the format would be consistent, I'll later provide more classes to write, related to specific functions.
from ea31337-classes.
So, something like this [1] ?
from ea31337-classes.
That's correct. I think making indentation for #ifdef
would look better if it's aligned with the code (the code would be more readable). Check for other missing date related functions as well. If there is any blocker function that can't be ported easily, add @todo
for MQL5 so you may ignore.
from ea31337-classes.
TimeTradeServer
has been added in MQL5 and has no equivalent for MQL4, I'll shift the # tokens once I submit a PR. The other options I didn't bring into the class are the ones that are available for both the versions and making a wrapper sounds quite pointless, no ?
from ea31337-classes.
If TimeTradeServer
not there in MQL4, you can still define the method, then return the value for MQL5 but NULL for MQL4 with some code comment (todo), probably this won't be used anyway.
from ea31337-classes.
Looks fine. I'll test it later on. Thanks.
from ea31337-classes.
Related Issues (20)
- PriceChannel: Wrong calculation
- New enum for Envelopes modes
- Support for both AND/OR operations for SOFM/SCFM
- Support for negative shifts
- Extend BarEntry with extra information
- Support for OHLC based on Bid/Ask prices
- Detect Wyckoff pattern
- Account::GetMarginFreeInPct() wrong calculation
- Strategy: Add OnOrderClose()/OnOrderModify()/OnOrderProcess()
- Order: OrderModify: Support for different request actions
- EA: OnOrderOpen: Add _request
- Indi_Account/Indi_Spread
- Calculate DXY (US Dollar Index) HOT 1
- Adds more trading hours
- Pattern: Chart's gaps
- Stop loss improvements
- MQL5: iMA/iOsMA/iMACD/etc on indicator
- Pattern: Add FVG Up/Dn
- 'SetDataSourceType' - undeclared identifier
- Matrix multiplication using OpenCL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ea31337-classes.