-
-
Notifications
You must be signed in to change notification settings - Fork 347
FIX: [ProfitFixer] warning on no trades and update fixed position timestamps #2247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
pkg/strategy/common/profit_fixer.go
Outdated
return err | ||
} | ||
if len(allTrades) == 0 { | ||
log.Warnf("no trades found for %s from %s to %s, skip profit fixing", symbol, since.String(), until.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "no trades found between t1 and t2"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
pkg/strategy/common/profit_fixer.go
Outdated
return err | ||
} | ||
// update position open time and changed time | ||
position.OpenedAt = since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use the time from the first trade
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
pkg/strategy/common/profit_fixer.go
Outdated
} | ||
// update position open time and changed time | ||
position.OpenedAt = since | ||
position.ChangedAt = allTrades[len(allTrades)-1].Time.Time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this field will be updated when a trade is added to the position?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right.
Will remove it
No description provided.