print a pretty table with correct country coder
This commit is contained in:
7
internal/trading212/constants.go
Normal file
7
internal/trading212/constants.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package trading212
|
||||
|
||||
import (
|
||||
"github.com/biter777/countries"
|
||||
)
|
||||
|
||||
const Country = countries.Cyprus
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/biter777/countries"
|
||||
"github.com/nmoniz/any2anexoj/internal"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
@@ -26,6 +27,14 @@ func (r Record) Symbol() string {
|
||||
return r.symbol
|
||||
}
|
||||
|
||||
func (r Record) BrokerCountry() int64 {
|
||||
return int64(Country)
|
||||
}
|
||||
|
||||
func (r Record) AssetCountry() int64 {
|
||||
return int64(countries.ByName(r.Symbol()[:2]).Info().Code)
|
||||
}
|
||||
|
||||
func (r Record) Side() internal.Side {
|
||||
return r.side
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user