Skip to content

Commit

Permalink
Fixed check03.
Browse files Browse the repository at this point in the history
  • Loading branch information
toomore committed May 17, 2015
1 parent be95e88 commit 9ef9cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/twsereport/check_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (check02) CheckFunc(b ...*twse.Data) bool {
type check03 struct{}

func (check03) String() string {
return "量價走平 45 天"
return "量或價走平 45 天"
}

func (check03) CheckFunc(b ...*twse.Data) bool {
Expand All @@ -91,7 +91,7 @@ func (check03) CheckFunc(b ...*twse.Data) bool {
}
var price = b[0].GetPriceList()
var volume = b[0].GetVolumeList()
return utils.SD(price) < 0.25 && utils.SDUint64(volume) < 0.25
return utils.SD(price[:45]) < 0.25 || utils.SDUint64(volume[:45]) < 0.25
}

func init() {
Expand Down
4 changes: 3 additions & 1 deletion cmd/twsereport/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ Run:
go func(check checkGroup, stock *twse.Data) {
runtime.Gosched()
if check.CheckFunc(stock) {
fmt.Printf("%s %s $%.2f %d\n", stock.No, stock.Name,
fmt.Printf("[%s] %s %s $%.2f %d\n",
check,
stock.No, stock.Name,
stock.GetPriceList()[len(stock.GetPriceList())-1],
stock.GetVolumeList()[len(stock.GetVolumeList())-1],
)
Expand Down

0 comments on commit 9ef9cb2

Please sign in to comment.