fix setting.
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
|||||||
"git.apinb.com/quant/gostock/internal/models"
|
"git.apinb.com/quant/gostock/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
DefaultClosedPnl float64 = 9
|
||||||
|
)
|
||||||
|
|
||||||
func Run(key string, ymd int) {
|
func Run(key string, ymd int) {
|
||||||
log.Println("Run Mock Order.")
|
log.Println("Run Mock Order.")
|
||||||
var stocks []*models.StratModel
|
var stocks []*models.StratModel
|
||||||
@@ -87,7 +91,7 @@ func Report() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3.判断盈亏超过10%,才确定平仓
|
// 3.判断盈亏超过10%,才确定平仓
|
||||||
if pnlRate >= 10 {
|
if pnlRate >= DefaultClosedPnl {
|
||||||
impl.DBService.Model(&models.MockPosition{}).Where("id=?", p.ID).Updates(map[string]any{
|
impl.DBService.Model(&models.MockPosition{}).Where("id=?", p.ID).Updates(map[string]any{
|
||||||
"close_price": newClosePrice,
|
"close_price": newClosePrice,
|
||||||
"pnl": pnl,
|
"pnl": pnl,
|
||||||
|
|||||||
Reference in New Issue
Block a user