Slippage and more statistics

This commit is contained in:
Luke I. Wilson
2023-05-18 20:17:29 -05:00
parent 565aa6c9fd
commit 5a0a4d0c33
5 changed files with 99 additions and 16 deletions

View File

@@ -57,6 +57,8 @@ type Position interface {
// - PositionClosed(Position) - Emitted after a position is closed either manually or automatically.
type Broker interface {
Signaler
Bid(symbol string) float64 // Bid returns the sell price of the symbol.
Ask(symbol string) float64 // Ask returns the buy price of the symbol, which is typically higher than the sell price.
// Candles returns a dataframe of candles for the given symbol, frequency, and count by querying the broker.
Candles(symbol, frequency string, count int) (*DataFrame, error)
MarketOrder(symbol string, units, stopLoss, takeProfit float64) (Order, error)