precompile.jl
1 using .Lang: @preset, @precomp 2 3 @preset let 4 a = Instruments.parse(Asset, "BTC/USDT") 5 e = ExchangeID(:bybit) 6 date = dt"2020-01-" 7 for T in (MarketOrderType, GTCOrderType, IOCOrderType, FOKOrderType), S in (Buy, Sell) 8 @precomp begin 9 o = Order(a, e, Order{T{S}}; price=10.0, date, amount=100.0, attrs=(;)) 10 hash(o) 11 orderside(o) 12 ordertype(o) 13 Trade(o; date, amount=10.0, price=10.0, fees=0.0, size=10.0, lev=1.0) 14 NotEnoughCash(0.1) 15 OrderTimeOut(o) 16 NotMatched(0.1, 0.1, 0.1, 0.1) 17 NotFilled(0.1, 0.1) 18 OrderFailed("abc") 19 end 20 end 21 end