Java/Linux advantages for algo trading

Discussion in 'Automated Trading' started by swinging tick, Feb 17, 2022.

  1. dholliday

    dholliday

    Lots of good replies. I use Java but came from a C++ background (mostly Visual C++).
    Unix/Linux, with modified kernels, is used for the fastest HFT. You don't need this.
    I have found that Linux is a pain for me. I upgrade to the latest version of IntelliJ/NetBeans, Gradle, Java (I'm currently on Java 16) about once a year. Inevitably, the latest versions will not work together, so have to downgrade to the lowest common denominator. Windows, fewer problems. I have several trading platforms that only work on Windows. So, I use Windows but IMHO, use the operating system that you are most comfortable with. Many Java programmers use MAC os.
    C++, Java/Kotlin, C# have very little speed difference. They all have thoroughly modern versions. All are a great choice for high performance. Java and C# are slower to start up and use more memory but the pluses for me outway the minuses. You won't outgrow any of them. Unless you are already a C/C++ programmer you should probably use Java/Kotlin/C#. If you want to program for Android Java/Kotlin.
    Unless you are looking at every tick of 1000+ symbols you can probably get by with Python. It is popular so lots of example code and many trading platforms support it. For a non-programmer, example trading code is very important.
    Please feel free to correct any errors.
     
    #11     Feb 17, 2022
  2. Unless you are a real techie, or you want to become one, I would forget about this advanced stuff like java and linux. You can go far by keeping it simple as the post above mentions in the end, and sticking with something like python. Yours won't be a top of the line application, but you can't compete with those guys anyway on those terms.
     
    #12     Feb 17, 2022
    swinging tick likes this.
  3. These two sentences are interesting because I always thought that the point of using Java is to be OS agnostic. At least is what they always sell to developers: "code once, run everywhere".
    Can you elaborate on the problems that make Windows better than Linux with Java?
     
    #13     Feb 18, 2022
  4. @dholliday , thanks!

    Python and other scripting languages are surely enough for checking setups while trading. But for running backtests / optimizations on large data sets, I found them to be slow. Which leaves me with the choice between Java and C#, and maybe Go.
     
    #14     Feb 18, 2022
  5. Guys and gals, let me ask, in terms of ease of use / faster development, which do you think is better: Java/Kotlin/C#?

    Also I dont hear people using Go for algo trading, did anyone have experience with it?
     
    #15     Feb 18, 2022
  6. After further researching this subject on internet, it seems to me Kotlin is the best fit for algo trading. Particularly in terms of:
    1) ease of writing (syntax),
    2) performance (same as Java),
    3) libraries availability / interoperability with Java,
    4) works on all OS
    It also is reassuring that Java is probably the most widely used language in algo trading/finance (my subjective observation)
     
    Last edited: Feb 18, 2022
    #16     Feb 18, 2022
  7. d08

    d08

    What makes linux and java "top of the line"? I don't understand how python is "keeping it simple". You can write complex applications using python. It's not just for scripting.

    You'd never write a reasonably complex backtesting algorithm in pure python. You can easily do it by using numpy/pandas etc, still writing your code in python without the speed disadvantages.

    Linux is only a pain if you're used to Windows and unwilling to adapt to something else. Once you migrate for good, you realise how terrible Windows is for anything technical, it's an OS for entertainment.
     
    #17     Feb 18, 2022
    voices - and swinging tick like this.
  8. As I understand you chose Python for your trading setup? Do you have any experience with Java/Kotlin? If so, how would you rate them against Python/Numpy in terms of performance and ease of development?
     
    #18     Feb 18, 2022
  9. d08

    d08

    I use python for trading and python/numpy (and others) for the backtesting platform.
    I haven't used Java but numpy is written in C so it's extremely fast. Unless you're doing HFT, the speed differences will be negligible.
    Python has many more libraries to offer, from what I've read, many more options compared to Java.
    I like that Java is statically typed and compiled but that's about it.
     
    #19     Feb 18, 2022
    swinging tick likes this.
  10. I agree with that, you can make python run lightning fast with numpy and other libraries (numba)
     
    #20     Feb 18, 2022
    d08 likes this.