2020.02.07 11:15 AM
t:`time xasc ([]sym: 10000?(),`a;time:10000?12:00:00;price:10000?100)
2020.02.07 12:08 PM
2020.02.07 12:50 PM
t:`time xasc ([]sym: 10000?(),`a;time:10000?12:00:00;price:10000?100;cond:10000#0.5);t:update priceCond:price*(1-cond) from t
sym time price cond priceCond passeda 00:00:02 59 0.5 29.5 00:01:01 a 00:00:33 98 0.5 49 00:00:58a 00:00:37 56 0.5 28 00:01:01a 00:00:58 41 0.5 20.5 ....a 00:01:00 51 0.5 25.5a 00:01:01 15 0.5 7.5a 00:01:12 15 0.5 7.5
2020.02.07 02:37 PM
q)system"S 10223" // fix seed for reproducibilityq)show t:`time xasc ([]sym:`a;time:10000?12:00:00;price:10000?1000f;cond:0.5)sym time price cond--------------------------a 00:00:01 320.1243 0.5a 00:00:02 887.3237 0.5a 00:00:03 927.6216 0.5a 00:00:04 726.379 0.5a 00:00:12 936.3665 0.5a 00:00:17 218.2577 0.5a 00:00:18 271.1841 0.5a 00:00:19 508.1405 0.5a 00:00:20 121.5772 0.5a 00:00:22 820.7361 0.5..q)show t:update priceCond:price*1-cond from tsym time price cond priceCond------------------------------------a 00:00:01 320.1243 0.5 160.0621a 00:00:02 887.3237 0.5 443.6619a 00:00:03 927.6216 0.5 463.8108a 00:00:04 726.379 0.5 363.1895a 00:00:12 936.3665 0.5 468.1832a 00:00:17 218.2577 0.5 109.1289a 00:00:18 271.1841 0.5 135.592a 00:00:19 508.1405 0.5 254.0702a 00:00:20 121.5772 0.5 60.78861a 00:00:22 820.7361 0.5 410.3681
q)show d:exec `s#reverse first each group mins price from t0.0587129| 25620.2813467| 8160.5073543| 4762.147674 | 4738.340432 | 3389.530393 | 2419.990613 | 13337.04542 | 10638.33161 | 7654.87185 | 1975.80056 | 10121.5772 | 8218.2577 | 5320.1243 | 0
q)d 50f76q)d 200f8q)d 10f133
q)t 133
sym | `a
time | 00:08:53
price | 9.990613
cond | 0.5
priceCond| 4.995307
q)update passed:time d price from tsym time price cond priceCond passed---------------------------------------------a 00:00:01 320.1243 0.5 160.0621 00:00:01a 00:00:02 887.3237 0.5 443.6619 00:00:01a 00:00:03 927.6216 0.5 463.8108 00:00:01a 00:00:04 726.379 0.5 363.1895 00:00:01a 00:00:12 936.3665 0.5 468.1832 00:00:01a 00:00:17 218.2577 0.5 109.1289 00:00:17a 00:00:18 271.1841 0.5 135.592 00:00:17a 00:00:19 508.1405 0.5 254.0702 00:00:01a 00:00:20 121.5772 0.5 60.78861 00:00:20a 00:00:22 820.7361 0.5 410.3681 00:00:01a 00:00:24 75.80056 0.5 37.90028 00:00:24a 00:00:26 725.6273 0.5 362.8136 00:00:01a 00:00:26 295.0753 0.5 147.5376 00:00:17..
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.