Code Monkey home page Code Monkey logo

Comments (2)

s2c avatar s2c commented on August 21, 2024

Have you looked at btgym @ https://github.com/Kismuz/btgym

I'm not 100% sure how it works yet, but it might be useful. The repo author has some implemented examples.

from tforce_btc_trader.

methenol avatar methenol commented on August 21, 2024

backtrader seems like a solid framework. Toyed with btgym that runs off of backtrader a bit but ran into issues using external data and didn't sink the time into changing the formatting to get it to play nice, but the goal was to pull from ccxt. The unreal LSTM strat in that repository is interesting.

Something to consider with the order types, not all exchanges support executing 'advanced' orders like that through their APIs (I believe kraken supports stop loss order, poloniex does not), so changing it at the level of what's sent to the API runs risk of limiting the supported exchanges. It seems like something that can easily be done via code, but should probably go into a separate process responsible for executing buy/sell orders and monitoring the ticker/order book.

Depending on the time scale you're looking at, time lag can turn a good buy/sell decision into a very bad one, pretty quickly. In an exchange with a maker/taker fee structure (most), we want maker as close to every time as we can to save those percents. That being said, there are times when taking a hit on the taker fee to secure an asset when the anticipated returns make up for the loss is better than not securing it at all.

Instead of doing highest bid or lowest ask, I take the highest bid and the bid below it, take the difference of those two and add it to the highest bid (same thing for the lowest ask), this pretty much guarantees slipping it in on a maker fee and puts it at the top of the book giving it a good chance of getting satisfied, then it's just a matter of refreshing the order if it doesn't get satisfied and the price shifts (have to determine if it's still a good decision at that point). When this gets screwy is when the spread between bids and asks is temporarily high due to volatility, might be worthwhile to wait a few ticks or base the order off the average spread prior to the execution tick?

Has anyone stumbled on any projects that feed the order book into a deep learning framework? I don't think the data is available historically through APIs which would limit the data to feed into backtesting, so it couldn't really be used as an 'indicator' in that sense, but feel it could be useful at least in the execution phase

from tforce_btc_trader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.