GoCryptoTrader Backtester: Slippage package
This slippage package is part of the GoCryptoTrader codebase.
This is still in active development
You can track ideas, planned features and what's in progress on our GoCryptoTrader Kanban board.
Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack
Slippage package overview
Slippage refers to the difference between the expected price of a trade and the price at which the trade is executed. Slippage is used here to simulate what would occur if trading was live as no perfect conditions exist for placing orders.
Slippage is calculated in two ways in the GoCryptoTrader Backtester
If RealOrders
is true
- The orderbook is frequently requested during live cycle candle retrieval
- When the order is being calculated in the
ExecuteOrder
eventhandler, it will use the orderbook to simulate placing the order and adjust the order price
If RealOrders
is false
- The
min-slippage-percent
and max-slippage-percent
values for the specific exchange, asset and currency pair will be used as bounds to simulate an orderbook using a random number
- If it is a buy order, it will raise the price by a random percentage between the two values
- If the order is a sell order, it will reduce the price by a random percentage between the two values
Contribution
Please feel free to submit any pull requests or suggest any desired features to be added.
When submitting a PR, please abide by our coding guidelines:
- Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
- Code must be documented adhering to the official Go commentary guidelines.
- Code must adhere to our coding style.
- Pull requests need to be based on and opened against the
master
branch.
Donations
If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc