dchrostowski / investopedia_simulator_api

A simple Python API for Investopedia's stock simulator games. This programmatically logs into Investopedia and can retrieve portfolio summary, get stock quotes & option chain lookups, execute trades - buy & sell shares, puts, calls, sell short, etc.
MIT License
36 stars 13 forks source link

Add support for asynchronous trading #10

Closed dchrostowski closed 5 years ago

dchrostowski commented 5 years ago

This may not be possible. This is because the csrf token is single use across all trades. As soon as the trade stock/option page refreshes, it invalidates the csrf token.

A synchronous task queue that implements threading would probably work best.

dchrostowski commented 5 years ago

Will implement a synchronous trade queue with concurrency using this:

https://gist.github.com/dchrostowski/aea07510fe5e76104eda25d740788a0f