mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
* docs: Create new CODING_GUIDELINES doc Rids excess contribution instructions from other packages Adds AGENTS.md file for the AI overlords Rids unused templates Updates ADD_NEW_EXCHANGE.md with minor fixes * docs: Fix linter issues and minor adjustments based on Copilot feedback * docs: Update coding guidelines for API parameters and testing practices * docs: Remove redundant GoDoc references Adds copilot-instructions.md * docs: Update CODING_GUIDELINES with export recommendations and test commentary * docs: Fix formatting inconsistencies in ADD_NEW_EXCHANGE.md links * docs: Update struct naming conventions for request and response types * docs: Improve clarity and consistency in ADD_NEW_EXCHANGE.md and CODING_GUIDELINES.md * refactor: Simplify error handling in QueryOrder method
18 lines
1.1 KiB
Cheetah
18 lines
1.1 KiB
Cheetah
{{define "backtester eventhandlers exchange slippage" -}}
|
|
{{template "backtester-header" .}}
|
|
## {{.CapitalName}} 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
|
|
|
|
{{template "donations" .}}
|
|
{{end}} |