mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 07:15:15 +00:00
add isolated margin symbol option
This commit is contained in:
parent
48083151aa
commit
310943d010
|
@ -56,6 +56,8 @@ type Session struct {
|
||||||
EnvVarPrefix string `json:"envVarPrefix" yaml:"envVarPrefix"`
|
EnvVarPrefix string `json:"envVarPrefix" yaml:"envVarPrefix"`
|
||||||
PublicOnly bool `json:"publicOnly,omitempty" yaml:"publicOnly"`
|
PublicOnly bool `json:"publicOnly,omitempty" yaml:"publicOnly"`
|
||||||
Margin bool `json:"margin,omitempty" yaml:"margin"`
|
Margin bool `json:"margin,omitempty" yaml:"margin"`
|
||||||
|
IsolatedMargin bool `json:"isolatedMargin,omitempty" yaml:"isolatedMargin,omitempty"`
|
||||||
|
IsolatedMarginSymbol string `json:"isolatedMarginSymbol,omitempty" yaml:"isolatedMarginSymbol,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Backtest struct {
|
type Backtest struct {
|
||||||
|
|
|
@ -147,7 +147,7 @@ func (environ *Environment) AddExchangesFromSessionConfig(sessions map[string]Se
|
||||||
return fmt.Errorf("exchange %s does not support margin", exchangeName)
|
return fmt.Errorf("exchange %s does not support margin", exchangeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
marginExchange.UseMargin(true)
|
marginExchange.UseIsolatedMargin(sessionConfig.Margin)
|
||||||
}
|
}
|
||||||
|
|
||||||
environ.AddExchange(sessionName, exchange)
|
environ.AddExchange(sessionName, exchange)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user