Advice for a Beginner Programmer

Discussion in 'App Development' started by zbojnik, Sep 10, 2012.

  1. hftvol

    hftvol

    With all due respect but do you realize what you essentially saying?

    Why would anyone pay for code or programmers, or traders, or basically anything under the sun if there was an abundance of it and it was easy so everyone could do it? The very reason for any commodity to have value is that it is rare and limited in supply and that not everybody can simply pick it up from the street.

    It just sounds to be you do not have much of an interest in digging into details whether it be programming or other things. Not trying to judge you just voicing my hunch. Problem is, if you wanna work on anything that requires computer code you do not get around digging into the basics first and then building up your skill set. Same with trading, there is no automated "trading robot" that does all the work for you, at least not one that is sold to the public or sold so you could afford it. So to get such "device" you gotta work on creating it. Same with your trading skills, if you want to become a true master at trading assets then you have to learn the basics and put in the hard work that is required to be competitive otherwise you end up being one of the masses who get ripped off by those who dared to put in the hard work. Simple as that, its human psychology btw not my wisdom.

    The absolute biggest problem I see with 95% of people on this site is that they are looking for SHORTCUTS. There are shortcuts in life but only very few manage to navigate the pitfalls that come along with shortcuts and make it. All others utterly fail in life. Is that a risk you are willing to take?

     
    #31     Mar 20, 2013
  2. swcom

    swcom

    I will add: The market does not hand out money to those who do not earn it... or rather, those who do not protect the capital in their trading account. Staring at the monitor during market hours does not qualify as billable hours in this equation either. The eSignal forums are laden with people asking questions about how to do the simplest of coding or calculations, and I mean easy stuff, and you can see right through them. I would guess that the tradestation forums are probably the same.

    OP: Programming a strategy or a trading system is not minutiae if you love the market, and how order flow works, and most importantly - learning why the bars print the way they do, and trying to decode price action between OHLC. This is why we're all here!

    Learn C++ (the root of pretty much everything (keep it to yourself propellerheads; different topic)) then Python, Javascript or whatever, and build a strategy that allows you to watch your efforts pay dividends, while you level the playing field. MACD and stochastics alone aint gonna get you there... not anymore.
     
    #32     May 6, 2013
  3. I would have to agree on this. C++ and Python are probably the way to go with the latter being the easier to learn. C++ will get you execution speed although Python has made a lot of speed improvements over the years. However, you need to consider the type of system you are building. If your bar length is a day, speed doesn’t really matter. Pick a language like Python or Visual Basic and code a system. If speed does matter then you might need to get into the nitty gritty details of C++.
     
    #33     May 8, 2013
  4. dholliday

    dholliday

    Don't worry about the language. Most any language is more than fast enough unless you are running a modified linux kernel and drivers, the absolute fastest data and broker, co-located, and execution costs way less than a retail broker can provide. C++ is fine, but those who think it is faster than C# or Java have an army of programmers to make it so, it's not easy. The reason that C/C++ is used by high-frequency firms is that they need to modify the linux kernel and drivers to optimize for low latency. Many use Java for their trading engine. They don't use Windows.

    Just to check, the other day when I was watching almost 1200 stock symbols, every tick (IQFeed), all with over 500k shares per day traded, my CPU usage, on a several year old laptop (1.7 GHz i7), ranged between 2 and 5 percent. This was about five minutes after the open.

    I was a C++ programmer for many years before I switched to Java in 1999 when Java really was slow. C/C++ have places where they are superior, but an auto-trading system is not one of them.

    Java is used in a great many high-performance systems by NASA, CERN, NASDAQ, and brokers in the systems that take and place your order.

    I imagine that C# has similar performance if you don't mind being on Windows only (those with any experience know that MONO is not an option). Also, you can program several retail platforms in C#, so that might make it a good choice for non-professionals.

    Both Java and C# have hundreds of languages that run on their respective VMs, so pick one and don't worry, if you can program it will be fast.

    -David


     
    #34     May 8, 2013
  5. +1

    I think this is the key post here!

    To me, it seems the OP is both a trading and programming novice. If that's true, then baby-steps are the key.

    OP, you can learn programming and build your program one block at a time.

    By tackling the smaller projects, ou'll quickly find out how involved the idea of writing your own platform is.

    Pick a few languages you'd like to learn (or think you *need* to learn) and perform some the following simple tasks:

    1. Write a program to download the historical data for every stock at Yahoo Finance and save it on your local hard drive. (hint - to get a list of all the available stocks, find the Sectors page, which will lead you to the Industries pages, which will have a list of all the stocks in that Industry)

    2. Enhance this program by opening each file, and parsing it so you can readily obtain any field in the file - date, open, high, low, close, volume, adj_close.

    3. Want to deal with the "real", non-split-adjusted prices? Figure out how to convert the OHLC data into non-split-adjusted prices (hint: you need to determine how close and adj_close are related to one another)

    4. Write another program that can find the all-time high and low of each stock (and the dates they occurred). (hint - you need to solve step 3 above before tackling this item)

    5. Modify #4 so that you can specify a start and end date on the command-line, and get the high and low prices within that time frame.

    6. Take these files, and figure out how to save data in a binary file. Or stuff them into a database or a file-based DBM like Berkeley DB. Or just changing the delimiter, and rewrite as a new text file. For the database portion, this means you'll need to set up a database server, create the database, schema, and tables. Then figure out how to connect to the server's socket, and issue SQL commands to the database. You'll need to learn the basics of SQL, of primary and foreign keyes, of constraints like UNIQUE, etc.

    7. Write a program that will read & parse the file and graph the price series. Read in each data file and create a chart (jpg or png) that you can view. Include the price series and volume in each chart.

    8. Modify the program in #7 to include a calculate and plot Simple Moving Averages of the closing price on your chart. Write your function so you can supply any period, and it'll calculate it. Aim to include 3 separate SMAs per chart.

    If you can complete these programs within the next 6 months, I'd be impressed.

    Note on choosing a language - find the one that you like and is easy to get started with. Many people tout low-level languages like C++ and C#, but in your case, that's putting the cart before the horse ... before the horse is even born...

    You really need to focus on using a high-level language that takes care of all the low-level stuff that'll bog you down - memory management and garbage collection, file handling, networking handling, string parsing, etc.

    I use Perl. I've used it for 20 years, and that's what I'm comfortable with. It has some things that many programmers find odd, but it's a full-featured language that excels at text-handling. It works just fine for building/maintaining a data infrastructure as well as testing any trade ideas.

    Others recommend Python and Ruby. All three are fine languages. I believe Perl is the fastest of the three, and it's the one that most resembles C (if you avoid the Perl idioms, which you shouldn't).

    Try each one and see which one you like. It's all about which language you like, are comfortable with, and are productive with. Perl, Python, and Ruby can do all the things you want to accomplish at this stage of the game, quickly and simply, without the massive complexity that comes with C++ or C#.

    Consider expanding from a Windows-centric perspective. Install VirtualBox and install Linux or FreeBSD as a guest. Running a Unix OS will show you how powerful a computer can be without requiring a GUI interface for everything. Install and configure SSH, and you'll be able to access your system from anywhere in the world that has Internet access.

    After a year or two, you should be in a better position to determine whether you really need to go to the next step and start using C++ or C#.

    Don't start with a low-level language until you really know what you need and want. And understand what parts are needed, and how they all interact with one another.

    You can't solve a problem if you don't know what the problem is or what the solution is supposed to look like.
     
    #35     May 22, 2013
  6. Another thought has come to mind...

    A programming language is just a tool. While it is important to choose the "right" tool for the job, it is not the most important thing, especially with a large project like a trading system.

    Tools are easy to use and learn.

    Rather, a programmer needs to develop and strengthen his ability to think logically. To plan each and every detail of a project. To anticipate how each component interacts with each other. To anticipate the unintended consequences - how parts of the system interact with ways that you didn't intend or expect. To be flexible - allowing for future changes and adaptations.

    You need to be able to think generically. How to design your functions and data structures so you can reuse them again.

    The biggest problem (new) programmers encounter is the need to rewrite most of their original code because they ...

    - didn't really know what they were trying to build
    - didn't know all the components needed for the project
    - implemented components, functions and data structures which were too specific
    - failed to look into the future and anticipate variations/additions in use (today you trade equities, in 2 years you trade currencies and futures. I bet your Instrument data structure can't handle currencies or futures. And you probably format prices to 2 decimal places)

    Programming is easy.... Design is very hard....

    Before programming a trading system, you need to understand programming AND trading.
     
    #36     May 23, 2013
  7. I have an open source platform this gives you an idea of how to build a system that is fine for trading at the 5sec bar + level with real time bid/ask/last price.

    https://code.google.com/p/trade-manager/

    Java based using mySQL DB standard hibernate JPA for DB access. Swing gui with simple MVC layer for each tab + main controller to interface to your broker layer. Currently only support IB TWS api (data and trading) and Yahoo (data). You can develop you own broker interface see broker package for relevant interface.

    Gives you a good idea for what it take to build an auto trading platform. Runs on Unix/Windows
     
    #37     Jun 18, 2013
  8. That trade manager software looks really cool. It’s a good idea at least. I’m not sure that it can ever match some of the commercial software out there though. I guess only time will tell.
     
    #38     Jun 28, 2013
  9. Interesting, thanks for sharing, will take a closer look. Looks cool at first sight, though.

    Speaking of programming languages, once you have learned one, you will find other somewhat similar, superficially speaking.

    You need to know/master more than one. I would go with C++/C# and Ruby/R.

    With those four, you can do a lot.
     
    #39     Jun 28, 2013
  10. Humpy

    Humpy

    I make that 3 ??
     
    #40     Jun 29, 2013