An object oriented language for Empty4

Re: An object oriented language for Empty4

Postby roger-write » Mon Feb 25, 2013 2:33 pm

NeoTrader wrote:It makes completely sense. Does this also mean that we could use OQ eventually with a continuous integration system later on if we have different libraries and create on top of these indicators, EA's or whatever?


If I understand Continuous Integration properly, then I believe so. In the build file, you can name modules individually, or whole directories that contain a subsystem with multiple modules. These get included into the project. So, for example, let's say you've developed a sub-system for, say, harmonics analysis. As long as someone using oq has your set of source files in a directory, all they have to do is name the directory in the build file and it sucks in your module. Obviously one subsystem may depend on another and that will all have to be documented in the subsystem description, etc.

And when including some new subsystem, obviously there will need to be some work to stitch it up to your EA or indicator's processes. But if a module uses a predefined template class and your code already talks to the template definition, then there can literally be plug and play stuff.....but i'm getting ahead of myself, since I don't currently have documentation and examples to back all this up.

NeoTrader wrote:The Template Idea sounds really great. Please don't forget to document this functionality and add also some implementation examples to it. It is sometimes a little difficult to grasp new concepts when you don't have proper examples and/or use-cases.


I agree. That's one reason I'm going back to the drawing board. I want to make sure oq is correct and then provide docs and examples.

NeoTrader wrote:Regarding your inputs from developers. If our platform is running we will have a idea management system up and running. I think your whole project could be a great asset in our toolset and you could use the infrastructure to get more input on different topics and discuss it also there.


Yes, that will be a great asset to have that kind of collaboration.

NeoTrader wrote:Did you have by any chance the opportunity to look into other Trading Platforms who already implemented OO based Languages (and I don' think about MT5 here.. ;) e.g. NinjaTrader which is based on C#).


I seriously considered Ninja and would have liked nothing more than to jump the Empty4 ship, scrap this project and embrace a real trading development environment. But after lots of consideration, realizing that it would be quite limiting from a broker standpoint, etc., is why I decided to stay the course. I haven't studied Ninja in any great detail, but it would probably be useful at some point. I know C#, so by that virtue, I know what their language looks like. oq is based somewhat loosely on C# as well.

But some things are emerging with oq that I didn't anticipate when I first started this project that are sort of cool. These things aren't really a "standard practice" sort of thing in OOP, but it's sort of like the language is here to serve the coder and so I might as well make it do what makes sense for it to do. Anyway, I'm starting to ramble. More on this later when I have actual documentation and examples.
roger-write
 
Posts: 63
Joined: Sat May 19, 2012 10:34 am

Re: An object oriented language for Empty4

Postby NeoTrader » Mon Feb 25, 2013 7:02 pm

Hi Roger,

I stumbled over an Article on the mql4.com site quite a while ago and I just remembered it and thought that you can maybe get some inspiration out of it for your Project.

It is called Object Approach in MQL.

Keep up the good work.


happy trading,

Robert

-
User avatar
NeoTrader
 
Posts: 436
Joined: Wed Apr 04, 2012 2:52 pm
Location: small Village at Lake Chiemsee, Bavaria, Germany

Re: An object oriented language for Empty4

Postby roger-write » Mon Feb 25, 2013 8:27 pm

NeoTrader wrote:I stumbled over an Article on the mql4.com site quite a while ago and I just remembered it and thought that you can maybe get some inspiration out of it for your Project.


Actually, the author of this article would no doubt be pleased that oq is being developed. It solves exactly what is being said. Notice section 2. with the switch statement. Oq builds the switch statements under the hood, so to speak. I used to do this manually and thought, "gee, why can't there be something that does this for me...."

Nice find on the article. Thanks.
roger-write
 
Posts: 63
Joined: Sat May 19, 2012 10:34 am

Re: An object oriented language for Empty4

Postby bodleytunes » Tue Feb 26, 2013 7:44 pm

Interesting stuff.

OO programming blows my tiny mind though as I'm just a hobbyist where my paid job is on Networks. My developer colleagues where I used to work tried to give me tips on how to program OO. In the end though, I spend much more time trying in vein to think how an object oriented programmer would tackle the problem in hand, rather than actually coding :(

I'm currently trying to port some EA's over to Dukascopy which uses Java (JForex)

I like Java very much, as even though I originally learned with C#, I'm very much anti-microsoft, and hate being a slave to Windows, so my main languages of interest are Java and Python because they are OS independent and very Linux friendly.

I just wish all brokers had a standard platform with API's for all the main languages.

That would be:

Java
C#
and Python - because its just great!!

Then the world would be a better place :D :ugeek:

Cheers!

Bod.
User avatar
bodleytunes
 
Posts: 70
Joined: Tue Oct 02, 2012 8:38 am
Location: Stockport

Re: An object oriented language for Empty4

Postby roger-write » Thu Mar 07, 2013 2:52 pm

For those interested in the ObjectQuotes project, I've been pretty busy behind the scenes, working full time on this. I'm nearing completion of a complete rewrite of the oq.exe program with the following goals:

  • Make it more accessible to coders
    + Import feature for existing mql projects
    + Commands for creating new empty shell projects for experts, indicators and scripts
    + Commands for working with the build file
  • Make it more about a better coding environment as opposed to ONLY being about object oriented
  • Improving the foundational concepts
  • The addition of native classes (this will grow over time) and are classes and functionality which has broad general appeal to coders and will natively be available as part of OQ
  • Build-in dynamic hierarchical resources (I know, a mouthful, right? - I promise it's cool stuff)
  • Build in object tree persistence for allowing coders to create class structures with persistence, meaning if you turn off your computer, get back into Empty4 and your EA, it will pick up exactly where it left off without missing a beat
  • Better plug-and-play module creation
  • Ability to override Empty4's built in functions if the coder chooses

While the new oq.exe program is almost done, I still need to create the coders guide and provide examples before the official 0.98 release. Starting Monday, I won't be able to work on this full time anymore as I am starting a long-term engineering contract. Have to pay the bills and all that. So I'll be going at a slower pace.

Once OQ 0.98 is released, work begins on what I'm calling the ObjectQuotes Standardized Templates. These will be template classes of various trading categories (think Trader, Signal, Study, EA Manager, etc.) and will essentially define how each of these interact with the client code using them. This will form the basis of the community sharing of modules for those who choose to adopt the OQ methodology. Over time, as a community these standardized templates will no doubt evolve based upon our collective thoughts and ideas.

So, it's in the works and will get there eventually.

Peace out!
roger-write
 
Posts: 63
Joined: Sat May 19, 2012 10:34 am

Re: An object oriented language for Empty4

Postby snailbeard » Tue Mar 12, 2013 9:01 am

Hi Roger,

Its very generous of you to share this project with the forum.

MQL makes me cry with frustration: after 20 years of OO S/W development myself - what a headache - so much typing to do basic things in MQL! And global variables all over the place!

I really want to migrate to a better platform, but if I cannot then this could really help improve my productivity and maybe help in the migration stages.

Perhaps it is possible to abstract the trading logic at a higher level so that migration is more straight forward in the future.

Anyway I look forward to trying out your framework when my current EA is regularly making a few pips, as I have a list of potential enhancements in my head, or should I just start from fresh on a proper trading platform - its difficult to know.

I look forward to exploring this in the future.

Brian
User avatar
snailbeard
 
Posts: 619
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Re: An object oriented language for Empty4

Postby roger-write » Wed Mar 13, 2013 8:01 pm

snailbeard wrote:Hi Roger,

Its very generous of you to share this project with the forum.

MQL makes me cry with frustration: after 20 years of OO S/W development myself - what a headache - so much typing to do basic things in MQL! And global variables all over the place!

I really want to migrate to a better platform, but if I cannot then this could really help improve my productivity and maybe help in the migration stages.

Perhaps it is possible to abstract the trading logic at a higher level so that migration is more straight forward in the future.

Anyway I look forward to trying out your framework when my current EA is regularly making a few pips, as I have a list of potential enhancements in my head, or should I just start from fresh on a proper trading platform - its difficult to know.

I look forward to exploring this in the future.

Brian


Yes, all the things you mentioned have gone through my mind as well - whether to switch or not. But every time I get serious about switching to another platform I realize that the brokers are limited and there is less available in the way of indicators/EA/code, etc. Ultimately this is what led me to the OQ project. I'm still moving forward on it, but slower now that I can't work full time. Plus I keep thinking of additional very useful features to add which are sort of "low hanging fruit", so the OQ spec keeps expanding a little bit further in typical programmer feature-creep manner. For example, the latest thing I added was a way to do callback functions on standard flat MQL functions. I suspect there are those out there that may never embrace OO, which is fine. A perfectly sensible argument could be made for a pure function based language. So, adding things like callbacks could be very useful to them.

At any rate, I'll keep things posted as I progress.
roger-write
 
Posts: 63
Joined: Sat May 19, 2012 10:34 am

Re: An object oriented language for Empty4

Postby eigenvector » Mon Apr 15, 2013 2:09 am

Hello Roger,

I admire the ambitious nature of the project. Anything that can make a developer's life easier with regards to creating MQL4 code is greatly appreciated and badly needed. I've read a few posts here from you and a couple of the other developers that talk about the pros and cons of jumping ship from Empty4 to some other platform. I have taken the plunge and am not looking back!

I've moved just about all of my serious development out of Empty4 as I don't have a high level of trust in either the data or the backtesting environment. Also the Empty4 framework is limited in that it isn't able to do multi-currency backtesting (well), genetic optimization, or portfolio optimization. For me the data is the lynch pin as getting high quality bid/ask data that is synchronized is a major accomplishment.

Those issues aside, I'm also working on my own system development framework, one that includes portfolio optimization, system development and backtesting using genetic optimization all done with high-quality synchronized bid-ask data. The most important aspect of a system development framework is the data.

For the trading / implementation part of things with Empty4 enabled brokers it can be as simple as executing a buy / sell / flat script. I have worked with this method of trade automation in the past and the execution can be very fast and accurate, and made nearly flawless in execution with a simple script based method.

In the case of simultaneously automating multiple systems, I'm considering a C# DLL based method to keep the Empty4 state in line with the system state. When dealing with multiple systems, Empty4 effectively only needs to know the net position for each pair. The problems that cause many forum posters to refer to Empty4 as Empty4 are limited to the code that executes orders. In my experience, trade logic can be written in and systems run in C# (pick your favorite language), and Empty4 interaction can simply be to tell it to buy or sell. In this way, when other platforms are added for trading, the trade execution code can simply be replaced / altered to adapt to a new trade platform API and the core trading logic / current trade state for each individual system is all kept nicely behind the scenes.
eigenvector
 
Posts: 20
Joined: Sat Jul 14, 2012 3:14 pm

Re: An object oriented language for Empty4

Postby raidsan » Sat Apr 20, 2013 5:37 am

well, it's just something i am looking for. I want to use OO to moding the Trend logic, and pattern recognition, include Elliott Wave, and I need add more additional class encapsulates, such as mt4gui to add user interaction, import and use fx news info etc.
work with raw Empty4 mql without OO, I almost can't finish the job, e.g. trend in fact will come from segment, segment will be nested on diff period level, manage the relation between segments, segment high/low point and caculate trendline...
mt5 work like c++ , but a lot work have done in Empty4 can't be reuse, and real account is not mt5,
moreover, I have use Empty4 offline chart to recieve china stock and future data, and I need use the same trade system to trace the chance.
raidsan
 
Posts: 5
Joined: Fri Apr 19, 2013 6:35 pm

Re: An object oriented language for Empty4

Postby roger-write » Mon Apr 22, 2013 1:25 pm

I'm still making progress, albeit very slowly. I try to work on this project several times a week and usually most of the day on Saturday. In terms of the actual compiler, etc., I've got one more major piece to work out, which is automated persistence. But there are a ton of little details, not to mention documentation, examples, etc.

While I don't have an exact time yet as to when version 0.98a will be done, the previous version was working (posted here) and that does give you OO. It worked, but it was a little clunkier than what 0.98a will be.

It's surprising how much slower things go when you have a day job, eh? :lol:
roger-write
 
Posts: 63
Joined: Sat May 19, 2012 10:34 am

PreviousNext

Return to Coders Hangout

Who is online

Users browsing this forum: No registered users and 1 guest