Question

I am new with Esper so i am unable to solve a simple problem. All i have to do is to get the difference of current close of bar with the previous close of bar. Whats the smartest way to approach this problem in esper?

Result= CurrentBar.Close - PreviousBar.Close.

EDIT:

I am using following piece of code will this work?

select
prev(0,close) - prev(1,close) as return,
security
from
Bar.win:length(2); 
Was it helpful?

Solution

The "prev()" special function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top