Home > Technical Topics > Automated Trading > Still confused, which language i should start learn to design my ATS?

Still confused, which language i should start learn to design my ATS?

  1. Hello,

    I would like to implement my trading rules into an automated system. I have worked with a professional MQL4 programmer to design my system using DLLs.

    However, now i would like to do the work by myself.

    Reasons:

    1- To protect my intellectual property.
    2- more freedom to change/develop.
    3- less cost
    4-many forums, easy to find codes, coders.

    Relevant characteristics of my system:
    1- for forex first.
    2-It include much of mathematics, indicators, complicated MM, risk and Trade managements.
    3-The most favorable conditions for this system is to work on the sub-minute time frames.
    4- it can trade " on the one minute time frame" 1000-2000 trades per day. and *5 times putting pending orders.
    5- It used too many pending orders.


    I know MT4 is sucks but i am thinking is to use MT4 for research/deveolpment and primary testing. .Once shows potentiality , i will move to a real platform and real programing language.

    Now, i am thinking/planning seriously to learn a programming language to work/design on a certain trading system roles.

    So, the question, to learn MQL4 or what?

    NB. I found i spent much time with programmers to explain so i think i could use this time for learning the language..
     
  2. I'd say use amibroker, it is good to start with.

    Then when things are all tested, move to a real-time trading environment that can interface with broker API.

    Getting things done is more of an issue than dealing with perceived worries about IP.
     
  3. Thank you for your advice. But why AFL? please elaborate. What do you mean by good to start with?

    Is it easy to learn? I know it has a good forum and support
     
  4. No one cares about your "IP".
    There is no "IP" in something as ordinary as Forex trading.
     

  5. The OP has found the Holy Grail :p
     
  6. Amibroker offers a very concise trading strategy develoment laguage (which means you do less typing and it's easier to read). Its backtester speed is unparallelled (I am not exagerrating). On the other hand, it's possible to create forward-looking systems if you are not careful and for automatic trading you will most likely have to rewrite the system in a different language.

    For easy development, C# is probably unopposed now. A few years back Visual Basic (not .NET) and Delphi were good options but now they seem somewhat in decline. Any other popular general pupose laguage will have a steeper learning curve. (By "general purpose" I mean languge available outside a proprietary trading platform like MQL in metatrader and EasyLanguage in tradestation and muticharts).

    Ultimately, the best language is the one that makes you personally most productive. If a platform doesn't support the laguage of your choice you are better of changing the platform.
     
  7. I think the developers of MT folks pretty much realized their platform MT4 platform sucks. That's why they came out with MT5.

    MT5 looks like it's geared for use with multiple brokers/data feeds and exchanges - not just forex. It won't surprise me if in a few years several brokers will offer it as a platform to trade stock/futures/equities etc. much like NinjaTrader or something.

    I have only briefly looked at MQL5 but what struck me is the use of OOP (Object Oriented programming) and layout of functions. It is almost identical to C++ which I favor. Take a look at it. It may be you can learn two lanquages in one - MQL5/C++. So if at some point in the future your ready to move on to a different broker/ data feed it should be easy to migrate with C++ by using a DLL or something which most other platforms offer.
     
  8. Yes
    :D :p
     
  9. I appreciate your opinion and i consider it but what i make me still hesitated to learn MQL5.
    1- little documentation,tutorial and support " forum"
    2-I heard that there are some bugs still
     
  10. Thank you for sharing your opinion.
    Do you think i could use Amibroker for trading with Dukascopy using API?
    So you recommend, either Amibroker or Tradelink (C#). I see both are good choices. However, by choosing either, would this limit the number of forex ECN brokers i could work with?
     
  11. I received a private message indicating what I wrote here isn't totally clear. Just to clarify...

    MQL and EasyLanguage may be easy to learn are NOT "general purpouse" laguages. They exist only as a part of the respective charting/backtesting/trading platform(s).

    If you learn C++, Delphi or C# you can use these to develop stand-alone applications. You can write you own text editor or even your own trading platform. You also wouldn't need a vendor's trading platfrom installed to run such an application.

    With C++, Delphi or C# you can write your own strategies for nearly any platform around (usually by creating a DLL): TradeStation, NeoTicker, NinjaTrader, AmiBroker, MultiCharts etc.

    With MQL or EasyLanguage you are stuck with 1 or 2 platfroms that support each language.

    MQL5 is not "identical" to C++ in any way. Yes, it has similar basic syntax, but so do C# and Java. MQL5 lacks features that define C++ as a different laguage: pointers and memory management, not to mention templates. As a result, porting any code that contains a few classes or an array will not be trivial (unless the person who does the porting is sufficiently fluent at C++).
     
  12. AmiBroker is great for backtesting but I don't recommend it for automated trading. It has trading interface only with IB and even that is in very rudimentary form. (Also AmiBroker has one of those proprietary programming languages I mentioned earlier... though you can connect DLLs to it.)

    I don't know enough about TradeLink to clearly recommend it. From a brief look the advanatges are:
    1) It's open-source. If you have a problem and skill you can fix a problem yourslef. If you need a feature you can add it yourself too. No need to wait for developers who may never honor your request.
    2) It can be linked to any broker API. If the broker connection is unsupported, you can implement it yourself. That's a consequence of open source. A minority fo commercial platforms (such as NeoTicker) allow users to implement theur own broker interfaces. However, majority of commercial platforms don't. If this is something important to you, choose carefully.
    3) Trading strategies don't have to be applied to a chart. So, you can comfortably run a large number fo them.

    Disadvanatges:
    1) It's open-source. So, like most open-source projects it may have a solid core but lacks bells and whistles.
    2) It seems to lack in the charting department. It is not a charting platform per se. So, the charts are just for convenience. However, I personally like visualizing ideas.
    3) Support... I understand you can purchase support if you want someone to help you resolve issues with the platfrom. So, it's whatever you pay for... like with commercial platforms.
     
  13. Thanks LeaD,

    So, if i choose amibroker, it will be great for developing/backtesting and when i need actual automated trading, i will convert my code to the code of interest to trade, right?.. If it works like this, It will be Ok for me.

    MQL4 is very limited for what i need.
    MQL5 is not yet inclined to use it
    EasyLanguage, i heard that it is not that Easy.
    C++, GREAT but need much skill and time devoting
    C#, great, easier to understand, still need skill and time


    My trading system now, it could be traded away from charts. During development and early research, i wanted the charts just to create the system and to observe. Now, roles could be implemented without any need of charting. The core ideas of my system now is more quantitative not visually dependable.

    Still need help.. to decide..

    Please share even if you feel it is well-known..
     
  14. Lee asked us to comment on his understandings about tradelink above.


    > I don't know enough about TradeLink to clearly recommend it. > > From a brief look the advanatges are:
    > 1) It's open-source. If you have a problem and skill you can fix a > problem yourslef. If you need a feature you can add it yourself > > too. No need to wait for developers who may never honor your > request.

    This is an advantage of open source. The other advantage is that you are starting out with a proven platform that is used by many people over many years. So your turn-up time should be around the same as with a commercial closed source system for trading, except that with open source you retain the option to evolve the platform in a different direction at any point.

    from oholho.net you can see the estimate cost to recreate a project like tradelink in developer time (not including test/qa/real money tests) :

    http://code.google.com/p/tradelink/wiki/ProjectStats

    > 2) It can be linked to any broker API. If the broker connection is > unsupported, you can implement it yourself. That's a
    > consequence of open source.

    Yes. To the original posters question this also makes it easier to add new connectors for any broker to the platform. Several of the connectors in our platform were developed by users and contributed back to the community.


    > 3) Trading strategies don't have to be applied to a chart. So,
    > you can comfortably run a large number fo them.

    Yes.

    Disadvanatges:
    > 1) It's open-source. So, like most open-source projects it may
    > have a solid core but lacks bells and whistles.

    Every software platform differentiates itself on what features it chooses to include and which ones it doesn't. So I'm not sure this has much to do with whether it's open source or not. Tradelink has features not available in closed source applications, and vicea verca.

    > 2) It seems to lack in the charting department. It is not a
    > charting platform per se. So, the charts are just for convenience. > However, I personally like visualizing ideas.

    TradeLink is not a charting platform. It does have charts though, which allow you to view bars on different time intervals, draw lines and text labels on the chart (both from the strategy and manually)

    [​IMG]

    http://code.google.com/p/tradelink/wiki/TradeLinkSuite?tm=6#Kadina

    > 3) Support... I understand you can purchase support if you want > someone to help you resolve issues with the platfrom. So, it's
    > whatever you pay for... like with commercial platforms.

    Yes. You can also get support for most issues from 200+ other tradelink users :

    http://groups.google.com/group/tradelink-users
     
  15. Thanks for a prompt reply!

    You are welcome! I woudl strongly recommend to avoid C++ unless you are already experienced with other programming languages. C++ requires greater understanding of how computers work. Further, in C++ there are a few types of difficult-to-track-down bugs (such as memory leaks, pointers to already deleted objects etc) which are impossible in C#, Java and most other popular languages.
     
  16. Thank you LeeD for helping mcgene4xpro.

    The thing that worries me is the money management/risk/trade management.

    I don't know the mathematics/indicators involved. Converting some hefty econometrics to something like EZLanguage or AFL might be a huge, wasteful effort, but we are all assuming that your calculations are simple. Thus simplicity of coding correlates strongly with likelihood of success. There are lots of packages that can do a good job with this.

    The money management/risk/trade management worries me. Most of the retail packages have only very crude features: 2% risk at entry, trailing stop. Is that the right level, or are we talking about value-at-risk and flattening accounts when markets get to correlated?

    The fact that you can trade on a 1 minute time frame helps enormously.

    As far as TradeLink goes, take a look at their offering. They have a nice video that will give you the flavor right-away.
    http://www.youtube.com/watch?v=tw87K349Cuw

    I agree with LeeD that learning C# is probably the right, future-oriented direction, but I don't have a real suggestion of platform without knowing better what you are doing.
     
  17. Steven.Davis. all good points!

    There is one I disagree with though:
    I believe when you take time and effort to code the whole trading systems yourself, a fair number of platforms allow setting stop to an arbitrary vulue on every bar or placing exit-at-market order. This is about as much flexibility as you can squeeze from a bar-based approach.

    Maybe I am not up-to-date with what "most of the retail packages" is like... I would apprecieate if you mention a few that strictly don't allow the strategy developer to code his or her arbitrary trade exit rules.

    I appreciate coding an entry signal and then sticking with pre-defined trade management rules may be tempting (as an easy way) but I don't think advanced trade management is something you expect to find in a platform. If a platform allows using your own rules, that's usually good enough.
     
  18. position sizing in amibroker is easy BTW....

    positionsize = -5; (5% allocation)

    or positionsize = 5 (allocates up to 5 positions (20% each)

    Or positionsize = -C/(3*ATR(10))

    this position allocated based on volatility

    You can augment stuff further positionsize = -Min(C/(3*ATR(10)),5)

    this allocates up to 5% in the positions, but is limited by the volatility calculation..

    Even more complicated scale in functions are possible, but that becomes difficult.
     
  19. I am thinking about things like non-trade specific circuit-breakers. Something like, if this managed account goes down 5% in a week, flatten all positions and take a two week time-out. If the S&P drops 200 points in a day, flatten all bullish positions. If your ten-minute value-at-risk doubles from the beginning of the day, close most liquid positions until value-at-risk is down to X% risk allowance.

    I don't know the Original Poster, but he says "complicated." I have seen circuit breakers on fairly modest CTA accounts. It can be a much of rotten cherry-picking, but I don't know what he has in mind.
     
  20. Aha. So, what you are saying is platforms may let diligent strategy developers code these "circuit-breakers" but retail platfroms don't offer "circuit-breakers" as a readily available overlay.
     
  21. Now, i am wondering why not learning JAVA which is a general purpose language and at the same time is the language of jforex of Dukascopy and i think marketcetera. I am thinking to jump to marketcetera on time later.

    What do you think about java. Learning wise/code programming wise?

    thanks.
     
  22. also , i have read this opinion to compare C++/C# and Java.

    Depends on the type of system. C++ is traditionally associated with finance applications because people use it to code fast monte-carlo models for pricing derivative securities. This is probably irrelevant if you're not a quantitative analyst (quant).

    For a trading floor system or other transactional application C++ will certainly get you faster performance and more transaction volume in a smaller memory footprint and less CPU. However, database and network performance are more likely to be a limiting factor, and Java or C# can be scaled by using clustered architectures.

    Java and C# can pause for garbage collection which leads to dead spaces in your application's response times. These delays might be unacceptable for some applications (e.g. algorithmic trading platforms) that need to support reliable realtime responses. In this case C++ allows you tighter control over this behaviour and may be preferable.

     
  23. One of the reasons to use C++ is there is a huge collection computational libraries in this laguage. Matrix algebra, optimisation, statistics. You name it! Further, for people who like it on the cheap, there are free libraries in Fortran that can be translated into C++ with f2c.

    With C++/CLI one can combine C++ and C# code in one project. As a result it's possible to take full advatage of where C# is the strongest, creating graphic user intefaces, and still use all the computational code in C++.