mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
types: add trade stats omitempty tag option
This commit is contained in:
parent
df8a4bef93
commit
53b8fd488e
|
@ -141,7 +141,7 @@ func (s IntervalProfitCollector) MarshalYAML() (interface{}, error) {
|
||||||
// TODO: Add more stats from the reference:
|
// TODO: Add more stats from the reference:
|
||||||
// See https://www.metatrader5.com/en/terminal/help/algotrading/testing_report
|
// See https://www.metatrader5.com/en/terminal/help/algotrading/testing_report
|
||||||
type TradeStats struct {
|
type TradeStats struct {
|
||||||
Symbol string `json:"symbol"`
|
Symbol string `json:"symbol,omitempty"`
|
||||||
|
|
||||||
WinningRatio fixedpoint.Value `json:"winningRatio" yaml:"winningRatio"`
|
WinningRatio fixedpoint.Value `json:"winningRatio" yaml:"winningRatio"`
|
||||||
NumOfLossTrade int `json:"numOfLossTrade" yaml:"numOfLossTrade"`
|
NumOfLossTrade int `json:"numOfLossTrade" yaml:"numOfLossTrade"`
|
||||||
|
@ -150,8 +150,8 @@ type TradeStats struct {
|
||||||
GrossProfit fixedpoint.Value `json:"grossProfit" yaml:"grossProfit"`
|
GrossProfit fixedpoint.Value `json:"grossProfit" yaml:"grossProfit"`
|
||||||
GrossLoss fixedpoint.Value `json:"grossLoss" yaml:"grossLoss"`
|
GrossLoss fixedpoint.Value `json:"grossLoss" yaml:"grossLoss"`
|
||||||
|
|
||||||
Profits []fixedpoint.Value `json:"profits" yaml:"profits"`
|
Profits []fixedpoint.Value `json:"profits,omitempty" yaml:"profits,omitempty"`
|
||||||
Losses []fixedpoint.Value `json:"losses" yaml:"losses"`
|
Losses []fixedpoint.Value `json:"losses,omitempty" yaml:"losses,omitempty"`
|
||||||
|
|
||||||
LargestProfitTrade fixedpoint.Value `json:"largestProfitTrade,omitempty" yaml:"largestProfitTrade"`
|
LargestProfitTrade fixedpoint.Value `json:"largestProfitTrade,omitempty" yaml:"largestProfitTrade"`
|
||||||
LargestLossTrade fixedpoint.Value `json:"largestLossTrade,omitempty" yaml:"largestLossTrade"`
|
LargestLossTrade fixedpoint.Value `json:"largestLossTrade,omitempty" yaml:"largestLossTrade"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user