How Do You Build Systems Using Python?

Discussion in 'App Development' started by tommo, Nov 21, 2016.

  1. userque

    userque

    I didn't mean to compare VB6 with Python. My point was that you don't seem to realize that there are GUI frameworks and advanced IDE's available for Python.

    But since you mentioned it, BASICA / QBASIC was my first language. My trading algo is currently coded in Excel VBA.
     
    #11     Nov 21, 2016
    d08 likes this.
  2. ck this guy out. You will learn a lot about python and program trading.
    https://pythonprogramming.net/
    https://www.youtube.com/user/sentdex/playlists
     
    #12     Nov 21, 2016
  3. d08

    d08

    That's how I always code, using a slightly customized syntax aware text editor, that doesn't mean the language is basic.Loading modules in Python is a breeze though, yes, some very basic things need a module but that makes sense from a performance perspective.

    While I haven't used VB myself, from what I know VB is just too old and a lot of the nasty outdated things have just stayed with it. People are mention stability problems.
    Obviously the code is so much cleaner with Python and easy to read, VB looks very messy.
     
    #13     Nov 21, 2016
  4. O(1)

    O(1)

    not a big fan of python, but did you see this..

    https://www.elitetrader.com/et/threads/qtpy-lib-a-new-algorithmic-trading-python-library.302115/
     
    #14     Nov 21, 2016
  5. kent

    kent

    Had a look at python code. Not much difference or difficulty compared to other programming languages. Instead of finding which language is best, you should have a system which is profitable. Of Course coding does help to test your systems faster. Goodluck.
     
    #15     Nov 22, 2016
  6. You might find my blog interesting
    http://qoppac.blogspot.co.uk/p/systematic-trading-start-here.html

    Or this one
    https://www.quantstart.com/

    There are more links here
    http://quantocracy.com/

    GAT
     
    #16     Nov 22, 2016
  7. tommo

    tommo

    Thanks for the answers. A few comments on whats been said so far.

    1/ The reason for choosing Python is from asking a lot of people in the industry it seems to be the fastest growing language in banking/finance. My main priority is to enhance my own prop trading career, but would be good to "future proof my resume and Python will open the doors i want to walk through.

    2/ Thanks for the links i will read through the blogs etc

    3/ Quantopia looks quite good, seems to only focus on stocks though

    4/ When you talk about libraries and GUI's is this like a palette of indicators etc? If i wrote "Bid Price" into Python would it know what i mean. Thats my main question i still dont seem to have answered (to my understanding) how to i write into Notepad etc a trading term will Python know the vocab i am using, i assume not. How do you get a trading vocab into Python?
     
    #17     Nov 22, 2016
  8. userque

    userque

    Suppose Quantopian, Metatrader, Amibroker, Ninjatrader, etc. are like the calculator app on your computer. You type "5" "+" "5" "=" and you see "10" displayed.

    Python won't do that until you give it instructions on _how_ to do that. Someone programmed the calculator app to simplify doing mathematics. Someone programmed the platforms listed above to simplify building algos etc.

    Here's some crude pseudo code ("mainly" based on old school BASIC) to do what the calculator app did above:
    Code:
    CLS
    PRINT "Please enter the first number.";
    INPUT numberInitial
    LET currentTotal=numberInitial
    DO
        PRINT "Please enter an operator: +, -, *, or /.";
        INPUT operator$
        PRINT "Please enter the next number.";
        INPUT number
        IF operator$="+" THEN currentTotal=currentTotal+number
        IF operator$="-" THEN currentTotal=currentTotal-number
        IF operator$="*" THEN currentTotal=currentTotal*number
        IF operator$="/" THEN currentTotal=currentTotal/number
    LOOP WHILE operator <>"="
    PRINT "The answer is ";currentTotal
    END
    
    You are given smaller building blocks with programming languages, so it takes 'a lot' to program something useful, but you have 'total' control over every aspect. The other platforms give you bigger building blocks, so you can do things faster/easier, at the expense of control.

    Libraries are essentially pre-built blocks of code that you can put into your program. These blocks do common, useful, and/or frequently used tasks, making programming faster/easier.

    Crude, simplified, trading program block 'diagram':

    Load historical EOD data (csv)
    Check if data is up to date
    No? Stop and display UPDATE DATA
    Calculate [location of] first free column
    Fill that column with SMA5
    Fill next column with RSI9
    ...etc...

    Each line above could represent several lines of code.
     
    #18     Nov 22, 2016
    alfa8 and tommo like this.
  9. tommo

    tommo

    Thanks Userque, thats what i was asking.
    Obviously it would take forever to code even a basic program if you have to explain every single element/word you want to use in a code. It takes long enough to design a robust strategy let alone having to explain in code what a bid price is, or a moving average.

    I assume Python trading libraries exist where you would just copy and paste the vocab into your code to save time.

    Surely there is some piece of software out there where all the trading vocabularly is already pre installed?
     
    #19     Nov 22, 2016
  10. Yes computers are like very dumb desk assistants, you have to explain to them exactly what do do. But once you've done it, they will do it repeatedly, and much faster than you can.

    There are python libraries for things like moving averages (pandas is the most famous one). You don't have to explain what a bid price is, that's just a number. So for example:

    moving_average=pandas.ewma(price, span=20)

    Yes there are several 'trading libraries'.

    quantopian is probably the best for someone who is relatively inexperienced but yes it's only for stocks right now. The other links I've sent you would require a better understanding of python than you have for now, but they are more flexible. Essentially the choice is:

    - more work done for you (more 'vocab') but less flexibility
    - less work done for you, more python you have to write, but more flexibility

    I think this is a very sensible approach. Ignore the language flame wars, I think for someone like you Python is perfect (but heck I'm biased).

    GAT
     
    #20     Nov 22, 2016
    d08 and tommo like this.