Developing "Spartan"

Discussion in 'Journals' started by nooby_mcnoob, Feb 3, 2019.

  1. Java is the only language I seem to understand. I keep on trying to understand Python, but somehow I am never able to analyze the functionality of a piece of Python code by reading it. So I stick to what I do understand. Hobby trader and hobby programmer.
     
    #341     Jan 10, 2020
  2. I think different languages appeal to different modes of thinking. I'm sure people with different learning styles "prefer" different programming languages.
     
    #342     Jan 10, 2020
  3. @nooby_mcnoob I noticed your keeness for ib_insync on another thread. Are you using it in production?

    Right not I plan to reinvent that particular wheel and wrap the python API myself as I've done in my current system, but I am not 100% decided (nearly at that decision point though).

    GAT
     
    #343     Jan 17, 2020
  4. I noticed that ib_insync is pretty popular among the people who post in the TWS-API group (https://groups.io/g/twsapi). I believe that you are also in that group.
     
    #344     Jan 17, 2020
  5. Yes I am using it, it's a no brainer in my opinion! But I do have my own interface on top of it.

    upload_2020-1-17_8-38-54.png
     
    #345     Jan 17, 2020
  6. I recently added the ability to trade futures to Spartan and obviously it isn't a complicated thing necessarily (handled similarly to options, with minor differences at the periphery), I thought it was pretty cool how easy it was for me to modify the same UI I use everywhere else to add the futures-specific stuff but just when trading futures. Here is the UI-related code:

    upload_2020-1-19_18-56-33.png

    Lets me toggle between using micros (for ES/NQ) by using the bindCheckbox button with a boolean value. I know it isn't impressive but I thought it was cool.
     
    #346     Jan 19, 2020
    d08 likes this.
  7. I just went through a terrifying ordeal with SQLite saying "Database is locked". Famous error message which drives people nuts.

    Apparently, some background process went crazy and left the DB open.

    No harm done.

    Should probably back it up though...
     
    #347     Jan 28, 2020
  8. Axon

    Axon

    I used to have a terrible CPU issue with Matplotlib and almost abandoned it but ended up solving it pretty easily. When you have your chart drawn out on the axis, everything on the chart can be accessed with the get_children() method for said axis. It's some kind of list and the first three elements in the list are always the candle bodies and stems. Call the remove() method on those and they disappear. Then just use the candlestick2_ohlc() function to put the updated candles back on there. It does completely redraw all the candles (though there is a way to just get the last one though I'm too lazy to put it together) but on my machine I can update my charts every 100 milliseconds and it takes about 10% CPU so maybe give that a shot. I'll attach a little snippet with some of the relevant code to give you an idea if you aren't familiar with it.

    Edit: If you Google candlestick2_ohlc you'll find plenty of stuff
     
    #348     Jan 28, 2020
    nooby_mcnoob likes this.
  9. Ooh thanks, I'll try this next time!
     
    #349     Jan 28, 2020
  10. One of the things I've been wanting/needing is cached bar calculations. I've got realtime/static charting built off of the tick database plus all my research is done off of the tick database. The simplest thing to do is probably to have a table per tick -> bar configuration I want and just update that in realtime as data comes in. This would centralize all the calculations.

    Not sure how other people deal with it.
     
    #350     Feb 13, 2020