diff --git a/epl/trading_system_1.epl b/epl/trading_system_1.epl index 78dc401..d455a3d 100644 --- a/epl/trading_system_1.epl +++ b/epl/trading_system_1.epl @@ -57,6 +57,12 @@ create variable bool InTradingHours = false on TickEvent as t set InTradingHours = EPLHelpers.inTimeRange(t.time, TradingStartTime, TradingEndTime) + +-- +-- In long position. Set later. +-- + +create variable bool InLongEntry = false -- @@ -228,6 +234,7 @@ insert into LongEntryStream and EPLHelpers.laterThan(B2.time, P2.time) and EPLHelpers.laterThan(P1.time, B2.time) and InTradingHours + and not InLongEntry -- Because multiple streams feed LongEntryStream (CurrentTick, -- MaxHigh3Window, B1, B2...), an event on any of those streams causes @@ -246,6 +253,14 @@ insert into LongEntryDistinct from pattern [every-distinct(le.time) le=LongEntryStream] +-- +-- Long entry derived variables +-- + +-- Register if We're in a long entry when we get the LongEntryDistinct +-- event. (InLongEntry is declared near top of file) +on LongEntryDistinct as le set InLongEntry = true + -- -- Event logging --