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

@@ -90,6 +90,7 @@ func TestBacktestingBrokerFunctions(t *testing.T) {
func TestBacktestingBrokerOrders(t *testing.T) {
data := newTestingDataframe()
broker := NewTestBroker(nil, data, 100_000, 50, 0, 0)
broker.Slippage = 0
timeBeforeOrder := time.Now()
order, err := broker.MarketOrder("EUR_USD", 50_000, 0, 0) // Buy 50,000 USD for 1000 EUR with no stop loss or take profit