For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Anyone use Alpaca? (Zero commision stock trading)



  • Hey all, I've just started using Backtrader and am still kind of learning the ropes of algorithmic trading in general. I've developed a few simple strategies, got some decent back testing results, and have a basic feel for the framework now so I decided to try and hook it up to Alpaca (<- referral link. Non-referral. There's no incentive at the moment.) to see how it performed live trading.

    Alpaca has their own module to interface with backtrader. It seems to connect but for some reason nothing changes in my Alpaca dashboard even though my backtrader output says that it's issuing trade orders. Has anyone had experience with this or know of common pitfalls for newbies? Or even if someone is just starting like me and wants to be a study buddy that'd be awesome!

    Another bummer is I'm not able to monitor my bt program while the market is open. It's hard to find and fix the issue when I can't get live feedback. Does anyone have suggestions on best practices for debugging in this situation?



  • @Devination Hi, I tried few days ago Alpaca and looks like withou funding account it's impossible to test it even for paper account. Maybe you know similiar services that could work with backtrader?



  • @Devination said in Anyone use Alpaca? (Zero commision stock trading):

    Another bummer is I'm not able to monitor my bt program while the market is open. It's hard to find and fix the issue when I can't get live feedback. Does anyone have suggestions on best practices for debugging in this situation?

    Although I'm using IB and not Alpaca - the best way I found to monitor the strategy is to use a simple logging ( a lot of it ). At the beginning I also enabled the IB debug mode - where all the IB API messages were re-routed to the strategy, where it could be logged. This way one may see exactly what is happening by just looking at the log file - live.

    There are also more advanced techniques that allow you to actively interact with the running strategy if you need such a control (works only on Linux):

    https://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application
    http://code.activestate.com/recipes/576515/

    One more tool that is sometimes useful (usually I'm using it for profiling but it could also be used to just see what is happening in the running python program without running it under debugger) is py-spy:

    https://pypi.org/project/py-spy/0.1.0/



  • Just realized I was answering the old original post. Sorry.


Log in to reply
 

});