How to use the .max() in timelion


(Cristian) #1

Hi All,
I use this expression:

Exp1
.es(_exists_:candles.highMid, timefield=candles.time,offset=-1d).if(eq, 0, null, .es(timefield=candles.time,offset=-1d,metric=sum:candles.highMid)).fit(average)

and this expression:

Exp2
.es(_exists_:candles.highMid, timefield=candles.time).if(eq, 0, null, .es(timefield=candles.time,metric=sum:candles.highMid)).fit(average)

But! I would like to plot the highest of these - max(Exp1, Exp2). Is this possible?

Br
Cris


(CJ Cenizal) #2

Hi there Cris, you can combine and compare your expressions using the max function like this:

.es(_exists_:candles.highMid, timefield=candles.time,offset=-1d).if(eq, 0, null, .es(timefield=candles.time,offset=-1d,metric=sum:candles.highMid)).fit(average).max(
  .es(_exists_:candles.highMid, timefield=candles.time).if(eq, 0, null, .es(timefield=candles.time,metric=sum:candles.highMid)).fit(average)
)

Hope this helps!

CJ


(Cristian) #3

Thanks! Works fine!.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.