Skip to content

Commit

Permalink
fix: update profit
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZhengZhao committed Nov 12, 2024
1 parent 4e647a0 commit e82ace3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func StartTrade() {

unRealizedProfit, _ := strconv.ParseFloat(position.UnRealizedProfit, 64)
leverage_float64, _ := strconv.ParseFloat(position.Leverage, 64)
entryPrice, _ := strconv.ParseFloat(position.EntryPrice, 64)
nowProfit := (unRealizedProfit / (positionAmtFloatAbs * entryPrice)) * leverage_float64 * 100 // 当前收益率(正为盈利,负为亏损)
markPrice_float64, _ := strconv.ParseFloat(position.MarkPrice, 64)
nowProfit := (unRealizedProfit / (positionAmtFloatAbs * markPrice_float64)) * leverage_float64 * 100 // 当前收益率(正为盈利,负为亏损)


if _, exist := exclude_symbols_map[position.Symbol]; exist { // 在白名单内
Expand Down

0 comments on commit e82ace3

Please sign in to comment.