-- test.epl - sample setup -- -- Statements must be separated by an empty line. -- The time the trading logic will begin to enter trades. -- Exiting trades is 24/7. create constant variable int StartTimeHour = 9 -- The time the trading logic will begin to enter trades. -- Exiting trades is 24/7. create constant variable int EndTimeHour = 17 -- The time frame or tickbar count of the data to be analyzed or -- traded. Examples: 5s, 1m, 1h 30m, 2h, 12h, 1d. create constant variable string Interval = '15s' -- Amount to be traded, measured in units. create constant variable int TradeSize = 100000 -- InTradingHours will be set to true if the current time is between -- StartTime and EndTime. create variable bool InTradingHours = false -- Update on each tick on TickEvent as t set InTradingHours = (EPLHelpers.getHour(t.time) >= StartTimeHour and EPLHelpers.getHour(t.time) < EndTimeHour) -- A stream of OHLC values create variant schema OHLCStream as OHLCEvent insert into OHLCStream select * from TickEvent#OHLC(Interval, time, midDouble) -- -- testing/debug/WIP below -- -- create window LongEntryTimeWindow#time(60 min) as -- select * from LongEntryEvent -- -- create window TicksTimeWindow#time(30 sec) as -- select * from TickEvent -- on TickEvent insert into TicksTimeWindow select * from TickEvent -- on TickEvent as t merge TicksTimeWindow as win -- where win.time -- insert into OrdersWindow select * from MerchandiseProductEvent -- set InTradingHours = -- (EPLHelpers.getHour(t.time) >= StartTimeHour and -- EPLHelpers.getHour(t.time) < EndTimeHour) -- LECount = (1,clock,60 min) == only allow one long entry per clock hour example: one LE between 1:00pm to 1:59pm -- B1 = ValueWhen( (ref(sma(5,c),-1)>ref(sma(5,c),-2)