Automated Trading - FAQs

Discussion in 'Automated Trading' started by Alpha Trader, Sep 3, 2014.

  1. Not having any experience in coding or algorithmic trading, there are a few questions I have that I would appreciate an input on. Please excuse the naivety of some questions that may come along with this lack of experience.

    I have numbered the questions to be answered individually.

    Your insight is greatly appreciated.

    Regards,

    Alpha.


    1) If I were to learn a single language (C++, Python, R etc), which one would it be.

    2) Can I get away with leaning only one language or is it a necessity to know others? If it is the later, can you please elaborate what the differences are and what each can do. Also what are the advantages of one over the other.

    3) How long does it take to learn a language to the capacity of being able to create your own algos with little/no outside help.

    4) How complicated can you make your algos? I know you can do simple stuff such as saying go long on the break of the previous bars high, if the volume is over x and 10MA is over 30MA.

    However, can you get really complex and say enter long on the break of the previous high if the last 4 bars prior to that have a body that is 80% of the total and the volume is at least 50% above average of the last 30 trading days and that the last 3 bars on a lower time frame closed higher than the open and the break to the new high is higher than over the last 8 trading days and MA are so and so, with the MACD being so and so etc etc.

    5) If I decided that I wanted to put most of my time into creating algo strategies rather than writing code, how expensive is it to hire someone.

    6) I'm assuming that in hiring someone, they would have a decent understanding in chart reading. If that is so, what is to say that they can not take my work elsewhere once the strategy is tried and tested and proves to be successful.

    7) I am a discretionary trader and even though I have my strategies and trading plans detailed, I will sometimes forgo a trade/setup if I notice the smallest of things that may skew the probability. Surely, this kind of detail is not worth coding for, purely based on the law of diminishing return. If I were to give an analogy based on manual trading and automated trading, would the following analogy be acceptable:

    "Going from Point A to Point B, a manual (stick shift) car would get you there faster (higher profits) and safer (tighter risk management) as you have a more defined control of the car as opposed to an automatic, which will none the less get you there, but a little slower and a little safer (i.e. money can still be made, but less).

    8) I am assuming that the purpose of automation is either to be able to diversify your trading, be able to take more setups than humanly possible or purely because you want to get away from the monitor. If the reason is getting away, does that not pose a threat to a trader as with time the sharpness/finesse/edge is eroded.

    9) If a particular algo is written, does it get confined to one stock/instrument or can it set up so it is continually searching for the criteria over 3000 pre-determined stocks.

    10) Will the rise of algorithmic trading be the death of discretionary trading (just like it was for the floor traders), or will discretionary trading always have it's own place. If you feel that automated trading will get rid of the discretionary function, how so? Please feel free to speculate on this as ideas that seem impossible today, may very well be implementable tomorrow.

    This is an interesting documentary on the changes brought about by the rise of computer trading, if it takes your interest:





    11) Are high probability algos scalable? Will the algo produce the same results when trading 10,000 shares as opposed to 100 shares.

    12) What is the average longevity of a particular strategy? Sometimes I hear that a particular strategy worked amazingly well for 18 months and than it stops making money. Does this happen to all strategies or are some more exposed to getting "expired" than others?

    Also, what are the contributing factors that lead to a healthy strategy losing it's effectiveness over time?
     
  2. rwk

    rwk

    You're asking interesting questions here. I'll bite, but keep in mind my opinions could be nonsense.

    1) computer language
    The best one is the one you already know. It's harder to get good at programming than most non-programmers expect. The best way to get good is to do it a lot. One of the following should be a safe choice.
    a) Basic is probably the easiest to learn for a beginner, and it works with Excel; Tradestation is basic-like.
    b) C# works with some powerful tools, such as NinjaTrader and Multicharts, but is mostly limited to Windows.
    c) Python works with Quantopian and maybe a few other tools, and it is modern and cross-platform.
    2) only one language
    Concentrate on one language and get good at that.
    3) How long does it take to learn a language
    Probably too long, and most people give up; but the programming is nothing compared with finding a profitable algo.
    4) How complicated can you make your algos?
    Neither rule-based example is particularly daunting; to be profitable, your algo will likely need to be non-obvious and hard to program; if it was easy, everybody would be doing it.
    5) hire someone
    Outsourcing is usually a waste of time and money; anybody who can program algos is already doing it.
    6) take my work elsewhere
    They own their knowledge; so don't give it away.
    7) discretionary
    The objective of algo trading should be to make a reasonable return and to secure a decent lifestyle.
    8) purpose of automation
    Diversification, more trades, waiting longer without trading, reacting more quickly, testing ideas before committing money.
    9) one stock/instrument
    If your algo only works on one issue, beware overfitting past data.
    10) algorithmic .. discretionary
    I think algo will kill discretionary someday, but I don't know when.
    11) scalable
    Not all algos scale well, including some of the best; but you can make a decent living with the small stuff.
    12) longevity
    Trading is a lot harder than it looks, so simple things keep working; but if you find something good, keep it to yourself and act dumb.
     
    nemesis45 and jl1575 like this.
  3. Actually, on the contrary. There's a good bit gained and your opinions are respectful.


    Why is it a waste of time and money? If you are to give someone a detailed description of the work required, do they have the ability to screw it up real bad?


    This is where the issue arises. As you had answered earlier, it takes a good time to learn how to code efficiently. Now if I am in the business of trading, I have no intentions of becoming a hot shot coder. However, without that, I can't put up an algo, no matter how good a strategy I have. It's a catch 22! :wtf:ops:

    Also, as you mentioned, they own their knowledge and so discussing my strategy seems like telling someone "Here's my bank card and pin number. I'll be back from my vacation in 2 weeks." SMH.

    On this, I'm actually more interested in how rather than when.


    :D:D:D

    This is so true. Some of the very successful traders I know share very similar traits. They don't have much of an interest in fast cars and big houses, but rather on impacting peoples lives in a positive manner. And you are so right about the acting dumb part - you would never guess their ability, financial capacity and intelligence by just looking at them. As they say, looks can be deceiving!

    Thanks for the response.
     
  4. rwk

    rwk

    outsourcing Why is it a waste of time and money? If you are to give someone a detailed description of the work required, do they have the ability to screw it up real bad?

    Unless you get uncommonly lucky, the programmer will take longer than expected and fail to deliver what you want or maybe anything at all. If you want it done right...

    they own their knowledge

    The only way I know to outsource the technology is to pay the workers enough so they're motivated to stay (i.e. golden handcuffs). That takes a lot of money, and it seems to be what the HFT firms are doing.

    learning to program As you had answered earlier, it takes a good time to learn how to code efficiently. Now if I am in the business of trading, I have no intentions of becoming a hot shot coder. However, without that, I can't put up an algo, no matter how good a strategy I have. It's a catch 22!

    I don't mean to say that you can't learn to be a competent programmer on the way to building algos. You may have a natural aptitude for it. But good programming is nontrivial and time-consuming.

    algo vs. discretionary On this, I'm actually more interested in how rather than when.

    With enough time and resources, computers can be programmed to do almost anything. There are probably matters, such as human values or creative leaps, that computers don't handle well. But they can outperform humans in speed, repetition, and accuracy. I think humans will continue to trade profitably for some time, especially at longer timeframes.
     
  5. 1) depends a lot on your needs. If I had to pic a general language, I would go with Python since it is a great all rounder, good for doing many different tasks but not really the best at any of them. Focuses on readability of the code and quick development times. A good approach to this problem is starting from the other end. If you have a broker or system where you want to write trading scripts (say, MT, esignal, tradestation) then start learning their scripting language... then find out which language is the base for the one you are using and learn that language. For example, esignal's language is based on javascript, so if you trade on esignal, learning javascript would be a natural move. Same goes from MT's scripting language and C...

    2) Specializing on one language has the advantage that it lets you get very fluent on that one language, but it also has a few short commings.
    a. it blinds you from that languages strenghs and weaknesses. you cant compare if you only know 1.
    b. how do you choose which one to learn? word of mouth? if you ask 10 developers you'll get 8 opinions on which is the best language, based on their own needs and perceptions... so learning a little of many languages is the only way to find the one where you really want to specialize.
    c. it puts you at risk of obsolesence. there is more than a few languages that have fallen out of fashion and didn't incorporate new programming features that later became common on modern languages. Think of the poor souls that spend their time coding Fortran or COBOL (yes, there are people that still use those languages day in day out!!!)
    Bjarne Stroustrup, the creator of C++, says that one should learn at least 5 languages. (Not saying that he is an oracle or something, but the guy knows a thing of 2). Why? because no language is perfect for all tasks, so knowing several helps you to know which one to use for which task. It also makes it easier for you to adapt to new languages and deepen your understanding of computer science as a whole.
    3) depends on the language. you can pickup languages like python, or R and be proficient at them in a matter of months... other languages like C++ are notorious for being expert friendly and can take a while to learn.
    this free class from GATech can take you from almost 0 to writting a basic automated investment system on python in 8 weeks.
    https://www.coursera.org/course/compinvesting1

    4) as complicated as you want and a little more! :D there is no such thing as small details when it comes to computers... remember that you are teaching a piece of sillicon to trade. that piece of sillicon has absolutely no intuition. If anything, putting together the system will push you to see small mundane details that you pay no attention to when you are trading, since you consider them intuitively without thinking about it.

    5) this depends. if you know 0 about computer systems, then the developer will know 100% of how everything works in your trading system. meaning that he will have a very strong incentive, and very few obstacles to trade the system himself! in this case you would need to pay him a good cut of the profits and provide other incentives to keep him from going solo... the more you know about computer systems the more you can slice the work into smaller pieces for many more developers, and this allows you to hold more leverage on them. If you know enough, you can even make it into granular pieces where you can even outsource much of the work without giving away the secret sauce...

    6) as in #5 depends on your side, how small can you cut the problem for them. the smaller the pieces, the less they need domain specific knowledge, and the less they can just take your secret sauce with them.

    7) on the contrary. the computer will NEVER forgo of ANY detail that you didn't specifically code for. It is a stupid piece of silicon that has 0 intuition, but has pefect logic and follows instructions in EXACTLY the same manner every time. No detail is too small. The machine needs you to pull out the microscope and let it know every tiny little detail, any detail you miss simply won't exist as far as the machine is concerned.

    8) trading more setups simultaneously is a normal objective for automation.
    you can't just let the system trade and go drink from colorful glasses with umbrella straws while the system makes money, you need to keep an eye on them and continuously work on new strategies.

    9) depends on the algo.

    10) that's a nice and very realistic movie.

    11) depends on the algo.

    12) depends on the algo :)
     
  6. I have a friend that is a very refined trader. He has such a passion for trading, that there was no way he was going to learn how to code. To him, every minute doing something else is a minute less of understanding the markets. However, his various strategies (I think he has 6 so far and working on more) are so unique and profitable, that he knew it was going to make him a pretty penny.

    Long story short, he quickly learnt that there was no way he was going to effectively execute his plan without the right people and so he formed a team and made them all partners to keep them from wandering away. Now he has 2 very seasoned programmers, a person that sets contracts and handles the legalities of leasing the algo to a few major funds here and in Europe and a person that collects private money which they trade on their unique algo.

    I never understood why he would give up on so much of his income, but looking at it now, it makes sense to see that he is making more, even after the profits are split and he can still do what he is happy doing, which is dissecting the markets.

    I'm guessing that when you say "enough", it probably means a good 6-7 figures per year.

    Comparing trading to programming sounds like being used to doses of Adderall and then having to switch to Xanax. It would have a numbing effect on my brain. :)
     
    eusdaiki likes this.
  7. IAS_LLC

    IAS_LLC

    I think your apprehension to learn how to code is misplaced. It is simply a tool that allows you meet your goals. Its not hard to get a basic understanding of how to code, it would probably take you a weekend (read one of the teach yourself C++ books.... thats how I started). Becoming skilled will take a while longer, but it is worth it. Anyway, If you need someone to code some strategies for you (It wont be free), send me a PM, and I may be able to help you out. Keep in mind, there is more to the task than just coding the strategy... You need to have a means of getting data to the strategy, managing risk, placing orders, monitoring open positions, etc. When I first started my journey into automated trading, I thought the majority of my time would be spent developing and testing strategies... but it turns out I have spend most of my time on the other things :(
     
    Alpha Trader and eusdaiki like this.
  8. yeah, sometimes "the trading part" of the work feels like the horizon... it's always in the todo list after getting all these other things ready... but the all these other things list keeps growing and growing as per murphy's law...
     
    Alpha Trader likes this.
  9. IAS_LLC

    IAS_LLC

    Absolutely. But, the trading part needs to be built on a solid foundation, so the "other stuff" is equally important.
     
    Alpha Trader and eusdaiki like this.
  10. @eusdaiki that is some pretty good information. However, your overall answer brings me to a crossroad faster than I expected.

    I entered this profession for the freedom it provides, both financially and of time. I am very comfortable in my intraday trading and wanted to find avenues to diversify. The two choices I had until now were indulging in options or increasing my activity in longer time frame trades. Basically, something that would generate more income. The option of algo trading seemed and even better idea (as it would fulfill both the criteria of financial gains and freeing up time), until the barriers that have been mentioned start popping up.

    The two barriers are:

    a) Learning to code: As you mentioned, everyone has a preference for their own language. Hence, learning multiple languages would consume a lot of my time. Additionally, once a preferred language is chosen, it would take even more time to be proficient at it, to be able to code competently. I understand the advantages it may bring with time, but I am not sure it is something that I will enjoy doing. Besides, I have a 0.5, 2 and 4 year old that I like spending time with. They grow ever so fast and I know that I will not get that time back, so time is a factor that can pinch a nerve or two on my side.

    b) Outsourcing/hiring: I really don't mind paying up for the service, if I were to get what I wanted and could find someone trustworthy. Sometimes it doesn't matter how much you pay someone, if they think they can make more (or even a little extra on the side), it's all game. So I have an issue of trust at this end. The loss of a few successful strategies would be unkind.

    Basically, it's a catch 22 here and it's something that I will have to find a solution to with time.
     
    #10     Sep 4, 2014