Skip to content

Commit

Permalink
fix: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZhengZhao committed Nov 17, 2024
1 parent 9a98963 commit 272e74e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ func (ctrl *FeatureController) TestStrategyRule() {
leverage_float64, _ := strconv.ParseFloat(position.Leverage, 64)
markPrice_float64, _ := strconv.ParseFloat(position.MarkPrice, 64)
nowProfit := (unRealizedProfit / (positionAmtFloatAbs * markPrice_float64)) * leverage_float64 * 100 // 当前收益率(正为盈利,负为亏损)
env["ORI"] = nowProfit
env["ROI"] = nowProfit
env["Position"] = positions[0]
} else {
env["ORI"] = 10.2
env["ROI"] = 10.2
env["Position"] = futures.PositionRisk{
EntryPrice: "68000.0",
MarkPrice: "72000.0",
Expand Down
2 changes: 1 addition & 1 deletion controllers/strategyTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (ctrl *StrategyTemplateController) TestStrategyRule() {
return
}
env := line.InitParseEnv(symbols.Symbol, symbols.Technology)
env["ORI"] = 10.2
env["ROI"] = 10.2
env["Position"] = futures.PositionRisk{
EntryPrice: "68000.0",
MarkPrice: "72000.0",
Expand Down

0 comments on commit 272e74e

Please sign in to comment.