indicator/till: fix e1 check

This commit is contained in:
c9s 2022-07-21 01:33:30 +08:00
parent 946fb96b03
commit 6e043ba129
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -87,7 +87,7 @@ func (inc *TILL) Length() int {
var _ types.Series = &TILL{}
func (inc *TILL) PushK(k types.KLine) {
if inc.e1.EndTime != zeroTime && k.EndTime.Before(inc.e1.EndTime) {
if inc.e1 != nil && inc.e1.EndTime != zeroTime && k.EndTime.Before(inc.e1.EndTime) {
return
}