Finally, it is starting to come together for me.

Discussion in 'App Development' started by GrowleyMonster, Jun 18, 2020.

  1. I had been struggling off and on trying to get started with the Alpaca API and Python. Nothing worked. I could never access my account. Tried everything, including installing Python 3 on my 16.04 machine. (Ubuntu 16.04 shipped with python2) and I figured it had something to do with incompatibility with the supplied version of python, and improper installation of python 3. I couldn't get pip to work. I couldn't get a call to the API to work. I couldn't do much of anything API related. Finally yesterday I backed up my Home directory and upgraded to 18.04 and then to 20.04 and switched back to the Unity desktop. Upgrading directly from 16.04 to 20.04 is not possible. The main reason for all that upgrading of an OS that will be supported through April of next year is for seamless use of python 3 which is shipped in Ubuntu 20.04. So then I used pip to install the SDK and it seemed to work. After about 15 minutes of coding and trying and coding and trying, I was finally able to access my account! Both the live account and the paper account!

    My first app will be something to tell me when I have my three allowed day trades within the 5 day period. I will probably make this a gui app using tkinter or PYQT. Finally, something useful. Then something to tell me how much actual cash I have available for trading. Oddly enough the Alpaca dashboard doesn't display that figure, nor does the TradingView interface which is what I have been using to trade with. Then some scanning tools. First algo trading app will probably trade pairs of ETFs, long and short, following the trend of the minute. The idea has fascinated me for a couple of years now. Well, crawl before you walk. I crawled today. Finally.

    I know this doesn't sound like much of an accomplishment to more experienced coders and algo traders, but it represents a lot of effort and frustration resolved into productivity. Also, those who have tried and failed to put together trading or trading related apps with Python, don't give up. And Ubuntu guys, don't waste your time with 16.04 or 18.04. The python and pip upgrades and the seamless way they work with Ubuntu make a big difference.
     
    tommcginnis and guru like this.
  2. traider

    traider

    install anaconda BOOM MAGIC
     
  3. d08

    d08

    Nothing wrong with either version. My cloud runs on 18.04 LTS and as long as you manage environmental vars -- Ubuntu needs python 3.6x while my trading runs on 3.8x. 18.04 is shipped with python 3...
     
  4. I guess you know what you are doing, then. I could never get it to work on 16.04, or even on 18.04 which I had on my IB/TWS trading machine. The current version does everything, once I figure it out.

    I have a console app now, that tells me my cash and my day trade count. Also time left til market open or close, and I will probably use that code for a countdown timer and alarm clock. I am feeling very optimistic now. I am gonna fool around with this more static stuff and build some gui for the next few weeks, then get some price and volume data and crunch it into rule based buy/sell orders on my paper trading account. This is going to be interesting and I hope maybe a little bit profitable.

    Anybody who says Python (or any programming language) is easy to learn, either is a lot more educated than me, or is still writing "hello world", and "click me" code. But I definitely got over a major speed bump in these last few days and it feels pretty good.
     
  5. d08

    d08

    Use pyenv or alternatives (update-alternatives) to manage versions to use. Python is easier than some other languages because you don't have to deal with the low level stuff.
     
    GrowleyMonster and Axon like this.