trading_system_1.epl: pass instrument and units in LongEntry events
This commit is contained in:
@ -170,7 +170,7 @@ insert into MaxHigh3Window
|
|||||||
|
|
||||||
-- Long entry events contain the current tick's midpoint value and
|
-- Long entry events contain the current tick's midpoint value and
|
||||||
-- timestamp.
|
-- timestamp.
|
||||||
create schema LongEntryStream as (current BigDecimal, time org.joda.time.DateTime)
|
create schema LongEntryStream as (current BigDecimal, time org.joda.time.DateTime, instrument String)
|
||||||
|
|
||||||
-- The long entry calc below is translated from this entry in the
|
-- The long entry calc below is translated from this entry in the
|
||||||
-- spreadsheet:
|
-- spreadsheet:
|
||||||
@ -183,7 +183,7 @@ create schema LongEntryStream as (current BigDecimal, time org.joda.time.DateTim
|
|||||||
-- and PT1 > BT2
|
-- and PT1 > BT2
|
||||||
|
|
||||||
insert into LongEntryStream
|
insert into LongEntryStream
|
||||||
select C.mid as current, C.time as time
|
select C.mid as current, C.time as time, C.instrument as instrument
|
||||||
from CurrentTickWindow as C,
|
from CurrentTickWindow as C,
|
||||||
MaxHigh3Window as T,
|
MaxHigh3Window as T,
|
||||||
B1#lastevent, B2#lastevent,
|
B1#lastevent, B2#lastevent,
|
||||||
@ -203,10 +203,13 @@ insert into LongEntryStream
|
|||||||
--
|
--
|
||||||
-- LongEntryDistinct filters out duplicate LongEntryStream events,
|
-- LongEntryDistinct filters out duplicate LongEntryStream events,
|
||||||
-- leaving a maximum of one event per tick.
|
-- leaving a maximum of one event per tick.
|
||||||
create schema LongEntryDistinct as (current BigDecimal, time org.joda.time.DateTime)
|
create schema LongEntryDistinct as (current BigDecimal, time org.joda.time.DateTime,
|
||||||
|
instrument String, units int)
|
||||||
|
|
||||||
|
-- TODO need instrument and units too
|
||||||
insert into LongEntryDistinct
|
insert into LongEntryDistinct
|
||||||
select le.current as current, le.time as time
|
select le.current as current, le.time as time,
|
||||||
|
le.instrument as instrument, TradeSize as units
|
||||||
from pattern [every-distinct(le.time) le=LongEntryStream]
|
from pattern [every-distinct(le.time) le=LongEntryStream]
|
||||||
|
|
||||||
-- The EsperProcessor java class has a listener for LongEntryDistinct
|
-- The EsperProcessor java class has a listener for LongEntryDistinct
|
||||||
|
|||||||
Reference in New Issue
Block a user