-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathprepare101.dos
1573 lines (1135 loc) · 59.7 KB
/
prepare101.dos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* *
* @ brief
* This script provides all necessary functions to prepare panel data for module wq101alpha.
* @ Author: DolphinDB
* @ Last modification time: 2023.04.18
* @ DolphinDB server version: 2.00.9
* @ FileName: prepare101.dos
*/
module prepare101
//1. Overall preparation
//Since the fields in the user's existing data table might be different from those in this module,
//we need to create an one-to-one dictionary of user fields and module fields,
//and return an in-memory table that matches the field names in this module for subsequent use.
//User must fill in rawData, startTime, endTime. "infoData" is the table that relates to industry classification.
def prepareData(rawData, startTime, endTime, securityidName=NULL, tradetimeName=NULL, openName=NULL, closeName=NULL, highName=NULL, lowName=NULL, volumeName=NULL, vwapName=NULL, capName=NULL, indclassName=NULL, infoData=NULL, infoSecurityidName=NULL){
officialNames = `securityid`tradetime`open`close`high`low`vol`vwap`cap`indclass`securityid
userNames = [securityidName, tradetimeName, openName, closeName, highName, lowName, volumeName, vwapName, capName, indclassName, infoSecurityidName]
namesMain = dict(STRING,STRING)
namesInfo = dict(STRING,STRING)
if (eqObj(infoData, NULL)){
num = 10
}else{ num = 8 }
for (i in 0:num){
// By default there will be 8 fields in rawData
if (userNames[i] != NULL) namesMain[officialNames[i]] = userNames[i]
}
colsMain = sqlColAlias(sqlCol(namesMain.values()), namesMain.keys())
whereCondition = expr(startTime, <=, sqlCol(tradetimeName), <=, endTime)
data = sql(select=colsMain, from=rawData, where=whereCondition)
if (eqObj(infoData, NULL)) return data.eval()
for (i in 8:11) {
// By default there will be 3 fields in infoData
if (userNames[i] != NULL) namesInfo[officialNames[i]] = userNames[i]
}
colsInfo = sqlColAlias(sqlCol(namesInfo.values()), namesInfo.keys())
info = sql(select=colsInfo, from=infoData)
return select * from ej(data.eval() as data, info.eval() as info, `securityid)
}
//2. Preparation for cross-sectional factors.
//The calculation process includes factors for time-series cross-sections or subject cross-sections (or both), without industry neutralization.
//These factors take panel data as parameters and return panel data.
//alpha 1
//rank(Ts_ArgMax(SignedPower((returns<0?stddev(returns,20):close), 2), 5))-0.5
//prepare panel data including close
def prepare1(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 2
//(-1 * correlation(rank(delta(log(volume), 2)), rank(((close - open) / open)), 6))
//prepare panel data including volume, close, open
def prepare2(data, startTime, endTime){
t = select securityid, tradetime, vol, close, open from data where tradetime between startTime : endTime
return dict(`vol`close`open, panel(t.tradetime, t.securityid, [t.vol, t.close, t.open]))
}
//alpha 3
//(-1 * correlation(rank(open), rank(volume), 10))
//prepare panel data including open, volume
def prepare3(data, startTime, endTime){
t = select securityid, tradetime, vol, open from data where tradetime between startTime : endTime
return dict(`vol`open, panel(t.tradetime, t.securityid, [t.vol, t.open]))
}
//alpha 4
//(-1 * Ts_Rank(rank(low), 9))
//prepare panel data including low
def prepare4(data, startTime, endTime){
p = exec low from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 5
//(rank((open - (sum(vwap, 10) / 10))) * (-1 * abs(rank((close - vwap)))))
//prepare panel data including vwap, open, close
def prepare5(data, startTime, endTime){
t = select securityid, tradetime, vwap, open, close from data where tradetime between startTime : endTime
return dict(`vwap`open`close, panel(t.tradetime, t.securityid, [t.vwap, t.open, t.close]))
}
//alpha 6
//(-1 * correlation(open, volume, 10))
//prepare panel data including open, volume
def prepare6(data, startTime, endTime){
t = select securityid, tradetime, vol, open from data where tradetime between startTime : endTime
return dict(`vol`open, panel(t.tradetime, t.securityid, [t.vol, t.open]))
}
//alpha 7
//((adv20 < volume) ? ((-1 * ts_rank(abs(delta(close, 7)), 60)) * sign(delta(close, 7))) : (-1 * 1))
//prepare panel data including vol, close
def prepare7(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 8
//(-1 * rank(((sum(open, 5) * sum(returns, 5)) - delay((sum(open, 5) * sum(returns, 5)), 10))))
//prepare panel data including open, close
def prepare8(data, startTime, endTime){
t = select securityid, tradetime, open, close from data where tradetime between startTime : endTime
return dict(`open`close, panel(t.tradetime, t.securityid, [t.open, t.close]))
}
//alpha 9
// ((0 < ts_min(delta(close, 1), 5)) ? delta(close, 1) : ((ts_max(delta(close, 1), 5) < 0) ? delta(close, 1) : (-1 * delta(close, 1))))
//prepare panel data including close
def prepare9(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 10
//rank(((0 < ts_min(delta(close, 1), 4)) ? delta(close, 1) : ((ts_max(delta(close, 1), 4) < 0) ? delta(close, 1) : (-1 * delta(close, 1)))))
//prepare panel data including close
def prepare10(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 11
//((rank(ts_max((vwap - close), 3)) + rank(ts_min((vwap - close), 3))) * rank(delta(volume, 3)))
//prepare panel data including vwap, vol, close
def prepare11(data, startTime, endTime){
t = select securityid, tradetime, vwap, vol, close from data where tradetime between startTime : endTime
return dict(`vwap`vol`close, panel(t.tradetime, t.securityid, [t.vwap, t.vol, t.close]))
}
//alpha 12
//(sign(delta(volume, 1)) * (-1 * delta(close, 1)))
//prepare panel data including vol, close
def prepare12(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 13
//(-1 * rank(covariance(rank(close), rank(volume), 5)))
//prepare panel data including vol, close
def prepare13(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 14
//((-1 * rank(delta(returns, 3))) * correlation(open, volume, 10))
//prepare panel data including vol, open, close
def prepare14(data, startTime, endTime){
t = select securityid, tradetime, vol, open, close from data where tradetime between startTime : endTime
return dict(`vol`open`close, panel(t.tradetime, t.securityid, [t.vol, t.open, t.close]))
}
//alpha 15
//(-1 * sum(rank(correlation(rank(high), rank(volume), 3)), 3))
//prepare panel data including vol, high
def prepare15(data, startTime, endTime){
t = select securityid, tradetime, vol, high from data where tradetime between startTime : endTime
return dict(`vol`high, panel(t.tradetime, t.securityid, [t.vol, t.high]))
}
//alpha 16
//(-1 * rank(covariance(rank(high), rank(volume), 5)))
//prepare panel data including vol, high
def prepare16(data, startTime, endTime){
t = select securityid, tradetime, vol, high from data where tradetime between startTime : endTime
return dict(`vol`high, panel(t.tradetime, t.securityid, [t.vol, t.high]))
}
//alpha 17
//(((-1 * rank(ts_rank(close, 10))) * rank(delta(delta(close, 1), 1))) * rank(ts_rank((volume / adv20), 5)))
//prepare panel data including vol, close
def prepare17(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 18
//(-1 * rank(((stddev(abs((close - open)), 5) + (close - open)) + correlation(close, open, 10))))
//prepare panel data including close, open
def prepare18(data, startTime, endTime){
t = select securityid, tradetime, close, open from data where tradetime between startTime : endTime
return dict(`close`open, panel(t.tradetime, t.securityid, [t.close, t.open]))
}
//alpha 19
//((-1 * sign(((close - delay(close, 7)) + delta(close, 7)))) * (1 + rank((1 + sum(returns, 250)))))
//prepare panel data including close
def prepare19(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 20
//(((-1 * rank((open - delay(high, 1)))) * rank((open - delay(close, 1)))) * rank((open - delay(low, 1))))
//prepare panel data including open, close, high, low
def prepare20(data, startTime, endTime){
t = select securityid, tradetime, open, close, high, low from data where tradetime between startTime : endTime
return dict(`open`close`high`low, panel(t.tradetime, t.securityid, [t.open, t.close, t.high, t.low]))
}
//alpha 21
//((((sum(close, 8) / 8) + stddev(close, 8)) < (sum(close, 2) / 2)) ? (-1 * 1) : (((sum(close, 2) / 2) < ((sum(close, 8) / 8) - stddev(close, 8))) ? 1 : (((1 < (volume / adv20)) || ((volume / adv20) == 1)) ? 1 : (-1 * 1))))
//prepare panel data including close, vol
def prepare21(data, startTime, endTime){
t = select securityid, tradetime, close, vol from data where tradetime between startTime : endTime
return dict(`close`vol, panel(t.tradetime, t.securityid, [t.close, t.vol]))
}
//alpha 22
//(-1 * (delta(correlation(high, volume, 5), 5) * rank(stddev(close, 20))))
//prepare panel data including close, vol, high
def prepare22(data, startTime, endTime){
t = select securityid, tradetime, close, vol, high from data where tradetime between startTime : endTime
return dict(`close`vol`high, panel(t.tradetime, t.securityid, [t.close, t.vol, t.high]))
}
//alpha 23
//(((sum(high, 20) / 20) < high) ? (-1 * delta(high, 2)) : 0)
//prepare panel data including high
def prepare23(data, startTime, endTime){
p = exec high from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 24
//((((delta((sum(close, 100) / 100), 100) / delay(close, 100)) < 0.05) || ((delta((sum(close, 100) / 100), 100) / delay(close, 100)) == 0.05)) ? (-1 * (close - ts_min(close, 100))) : (-1 * delta(close, 3)))
//prepare panel data including close
def prepare24(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 25
//rank(((((-1 * returns) * adv20) * vwap) * (high - close)))
//prepare panel data including close, vol, high, vwap
def prepare25(data, startTime, endTime){
t = select securityid, tradetime, close, vol, high, vwap from data where tradetime between startTime : endTime
return dict(`close`vol`high`vwap, panel(t.tradetime, t.securityid, [t.close, t.vol, t.high, t.vwap]))
}
//alpha 26
//(-1 * ts_max(correlation(ts_rank(volume, 5), ts_rank(high, 5), 5), 3))
//prepare panel data including vol, high
def prepare26(data, startTime, endTime){
t = select securityid, tradetime, vol, high from data where tradetime between startTime : endTime
return dict(`vol`high, panel(t.tradetime, t.securityid, [t.vol, t.high]))
}
//alpha 27
//((0.5 < rank((sum(correlation(rank(volume), rank(vwap), 6), 2) / 2.0))) ? (-1 * 1) : 1)
//prepare panel data including vol, vwap
def prepare27(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap from data where tradetime between startTime : endTime
return dict(`vol`vwap, panel(t.tradetime, t.securityid, [t.vol, t.vwap]))
}
//alpha 28
//scale(((correlation(adv20, low, 5) + ((high + low) / 2)) - close))
//prepare panel data including vol, high, low, close
def prepare28(data, startTime, endTime){
t = select securityid, tradetime, vol, high, low, close from data where tradetime between startTime : endTime
return dict(`vol`high`low`close, panel(t.tradetime, t.securityid, [t.vol, t.high, t.low, t.close]))
}
//alpha 29
//(min(product(rank(rank(scale(log(sum(ts_min(rank(rank((-1 * rank(delta((close - 1), 5))))), 2), 1))))), 1), 5) + ts_rank(delay((-1 * returns), 6), 5))
//prepare panel data including close
def prepare29(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 30
//(((1.0 - rank(((sign((close - delay(close, 1))) + sign((delay(close, 1) - delay(close, 2)))) + sign((delay(close, 2) - delay(close, 3)))))) * sum(volume, 5)) / sum(volume, 20))
//prepare panel data including vol, close
def prepare30(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 31
// ((rank(rank(rank(decay_linear((-1 * rank(rank(delta(close, 10)))), 10)))) + rank((-1 * delta(close, 3)))) + sign(scale(correlation(adv20, low, 12))))
//prepare panel data including vol, close, low
def prepare31(data, startTime, endTime){
t = select securityid, tradetime, vol, close, low from data where tradetime between startTime : endTime
return dict(`vol`close`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.low]))
}
//alpha 32
//(scale(((sum(close, 7) / 7) - close)) + (20 * scale(correlation(vwap, delay(close, 5), 230))))
//prepare panel data including close, vwap
def prepare32(data, startTime, endTime){
t = select securityid, tradetime, close, vwap from data where tradetime between startTime : endTime
return dict(`close`vwap, panel(t.tradetime, t.securityid, [t.close, t.vwap]))
}
//alpha 33
//rank((-1 * ((1 - (open / close))^1)))
//prepare panel data including open, close
def prepare33(data, startTime, endTime){
t = select securityid, tradetime, open, close from data where tradetime between startTime : endTime
return dict(`open`close, panel(t.tradetime, t.securityid, [t.open, t.close]))
}
//alpha 34
//rank(((1 - rank((stddev(returns, 2) / stddev(returns, 5)))) + (1 - rank(delta(close, 1)))))
//prepare panel data including close
def prepare34(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 35
//((Ts_Rank(volume, 32) * (1 - Ts_Rank(((close + high) - low), 16))) * (1 - Ts_Rank(returns, 32)))
//prepare panel data including vol, close, high, low
def prepare35(data, startTime, endTime){
t = select securityid, tradetime, vol, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.high, t.low]))
}
//alpha 36
//(((((2.21 * rank(correlation((close - open), delay(volume, 1), 15))) + (0.7 * rank((open - close)))) + (0.73 * rank(Ts_Rank(delay((-1 * returns), 6), 5)))) + rank(abs(correlation(vwap, adv20, 6)))) + (0.6 * rank((((sum(close, 200) / 200) - open) * (close - open)))))
//prepare panel data including vol, open, close, vwap
def prepare36(data, startTime, endTime){
t = select securityid, tradetime, vol, open, close, vwap from data where tradetime between startTime : endTime
return dict(`vol`open`close`vwap, panel(t.tradetime, t.securityid, [t.vol, t.open, t.close, t.vwap]))
}
//alpha 37
//(rank(correlation(delay((open - close), 1), close, 200)) + rank((open - close)))
//prepare panel data including open, close
def prepare37(data, startTime, endTime){
t = select securityid, tradetime, open, close from data where tradetime between startTime : endTime
return dict(`open`close, panel(t.tradetime, t.securityid, [t.open, t.close]))
}
//alpha 38
//((-1 * rank(Ts_Rank(close, 10))) * rank((close / open)))
//prepare panel data including open, close
def prepare38(data, startTime, endTime){
t = select securityid, tradetime, open, close from data where tradetime between startTime : endTime
return dict(`open`close, panel(t.tradetime, t.securityid, [t.open, t.close]))
}
//alpha 39
//((-1 * rank((delta(close, 7) * (1 - rank(decay_linear((volume / adv20), 9)))))) * (1 + rank(sum(returns, 250))))
//prepare panel data including vol, close
def prepare39(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 40
//((-1 * rank(stddev(high, 10))) * correlation(high, volume, 10))
//prepare panel data including vol, high
def prepare40(data, startTime, endTime){
t = select securityid, tradetime, vol, high from data where tradetime between startTime : endTime
return dict(`vol`high, panel(t.tradetime, t.securityid, [t.vol, t.high]))
}
//alpha 41
//(((high * low)^0.5) - vwap)
//prepare panel data including high, low, vwap
def prepare41(data, startTime, endTime){
t = select securityid, tradetime, high, low, vwap from data where tradetime between startTime : endTime
return dict(`high`low`vwap, panel(t.tradetime, t.securityid, [t.high, t.low, t.vwap]))
}
//alpha 42
//(rank((vwap - close)) / rank((vwap + close)))
//prepare panel data including vwap, close
def prepare42(data, startTime, endTime){
t = select securityid, tradetime, vwap, close from data where tradetime between startTime : endTime
return dict(`vwap`close, panel(t.tradetime, t.securityid, [t.vwap, t.close]))
}
//alpha 43
//(ts_rank((volume / adv20), 20) * ts_rank((-1 * delta(close, 7)), 8))
//prepare panel data including vol, close
def prepare43(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 44
//(-1 * correlation(high, rank(volume), 5))
//prepare panel data including vol, high
def prepare44(data, startTime, endTime){
t = select securityid, tradetime, vol, high from data where tradetime between startTime : endTime
return dict(`vol`high, panel(t.tradetime, t.securityid, [t.vol, t.high]))
}
//alpha 45
//(-1 * ((rank((sum(delay(close, 5), 20) / 20)) * correlation(close, volume, 2)) * rank(correlation(sum(close, 5), sum(close, 20), 2))))
//prepare panel data including vol, close
def prepare45(data, startTime, endTime){
t = select securityid, tradetime, vol, close from data where tradetime between startTime : endTime
return dict(`vol`close, panel(t.tradetime, t.securityid, [t.vol, t.close]))
}
//alpha 46
//((0.25 < (((delay(close, 20) - delay(close, 10)) / 10) - ((delay(close, 10) - close) / 10))) ? (-1 * 1) : (((((delay(close, 20) - delay(close, 10)) / 10) - ((delay(close, 10) - close) / 10)) < 0) ? 1 : ((-1 * 1) * (close - delay(close, 1)))))
//prepare panel data including close
def prepare46(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 47
//((((rank((1 / close)) * volume) / adv20) * ((high * rank((high - close))) / (sum(high, 5) / 5))) - rank((vwap - delay(vwap, 5))))
//prepare panel data including vol, close, high, vwap
def prepare47(data, startTime, endTime){
t = select securityid, tradetime, vol, close, high, vwap from data where tradetime between startTime : endTime
return dict(`vol`close`high`vwap, panel(t.tradetime, t.securityid, [t.vol, t.close, t.high, t.vwap]))
}
//alpha 49
//(((((delay(close, 20) - delay(close, 10)) / 10) - ((delay(close, 10) - close) / 10)) < (-1 * 0.1)) ? 1 : ((-1 * 1) * (close - delay(close, 1))))
//prepare panel data including close
def prepare49(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 50
//(-1 * ts_max(rank(correlation(rank(volume), rank(vwap), 5)), 5))
//prepare panel data including vol, vwap
def prepare50(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap from data where tradetime between startTime : endTime
return dict(`vol`vwap, panel(t.tradetime, t.securityid, [t.vol, t.vwap]))
}
//alpha 51
//(((((delay(close, 20) - delay(close, 10)) / 10) - ((delay(close, 10) - close) / 10)) < (-1 * 0.05)) ? 1 : ((-1 * 1) * (close - delay(close, 1))))
//prepare panel data including close
def prepare51(data, startTime, endTime){
p = exec close from data where tradetime between startTime : endTime pivot by tradetime, securityid
return p
}
//alpha 52
//((((-1 * ts_min(low, 5)) + delay(ts_min(low, 5), 5)) * rank(((sum(returns, 240) - sum(returns, 20)) / 220))) * ts_rank(volume, 5))
//prepare panel data including vol, close, low
def prepare52(data, startTime, endTime){
t = select securityid, tradetime, vol, close, low from data where tradetime between startTime : endTime
return dict(`vol`close`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.low]))
}
//alpha 53
//(-1 * delta((((close - low) - (high - close)) / (close - low)), 9))
//prepare panel data including close, high, low
def prepare53(data, startTime, endTime){
t = select securityid, tradetime, close, high, low from data where tradetime between startTime : endTime
return dict(`close`high`low, panel(t.tradetime, t.securityid, [t.close, t.high, t.low]))
}
//alpha 54
//((-1 * ((low - close) * (open^5))) / ((low - high) * (close^5)))
//prepare panel data including open, close, high, low
def prepare54(data, startTime, endTime){
t = select securityid, tradetime, open, close, high, low from data where tradetime between startTime : endTime
return dict(`open`close`high`low, panel(t.tradetime, t.securityid, [t.open, t.close, t.high, t.low]))
}
//alpha 55
//(-1 * correlation(rank(((close - ts_min(low, 12)) / (ts_max(high, 12) - ts_min(low, 12)))), rank(volume), 6))
//prepare panel data including vol, close, high, low
def prepare55(data, startTime, endTime){
t = select securityid, tradetime, vol, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.high, t.low]))
}
//alpha 57
//(0 - (1 * ((close - vwap) / decay_linear(rank(ts_argmax(close, 30)), 2))))
//prepare panel data including close, vwap
def prepare57(data, startTime, endTime){
t = select securityid, tradetime, close, vwap from data where tradetime between startTime : endTime
return dict(`close`vwap, panel(t.tradetime, t.securityid, [t.close, t.vwap]))
}
//alpha 60
//(0 - (1 * ((2 * scale(rank(((((close - low) - (high - close)) / (high - low)) * volume)))) - scale(rank(ts_argmax(close, 10))))))
//prepare panel data including vol, close, high, low
def prepare60(data, startTime, endTime){
t = select securityid, tradetime, vol, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.high, t.low]))
}
//alpha 61
//(rank((vwap - ts_min(vwap, 16.1219))) < rank(correlation(vwap, adv180, 17.9282)))
//prepare panel data including vol, vwap
def prepare61(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap from data where tradetime between startTime : endTime
return dict(`vol`vwap, panel(t.tradetime, t.securityid, [t.vol, t.vwap]))
}
//alpha 62
//((rank(correlation(vwap, sum(adv20, 22.4101), 9.91009)) < rank(((rank(open) + rank(open)) < (rank(((high + low) / 2)) + rank(high))))) * -1)
//prepare panel data including vol, vwap, open, high, low
def prepare62(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, open, high, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`open`high`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.open, t.high, t.low]))
}
//alpha 64
//((rank(correlation(sum(((open * 0.178404) + (low * (1 - 0.178404))), 12.7054), sum(adv120, 12.7054), 16.6208)) < rank(delta(((((high + low) / 2) * 0.178404) + (vwap * (1 - 0.178404))), 3.69741))) * -1)
//prepare panel data including vol, vwap, open, high, low
def prepare64(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, open, high, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`open`high`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.open, t.high, t.low]))
}
//alpha 65
//((rank(correlation(((open * 0.00817205) + (vwap * (1 - 0.00817205))), sum(adv60, 8.6911), 6.40374)) < rank((open - ts_min(open, 13.635)))) * -1)
//prepare panel data including vol, vwap, open
def prepare65(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, open from data where tradetime between startTime : endTime
return dict(`vol`vwap`open, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.open]))
}
//alpha 66
//((rank(decay_linear(delta(vwap, 3.51013), 7.23052)) + Ts_Rank(decay_linear(((((low * 0.96633) + (low * (1 - 0.96633))) - vwap) / (open - ((high + low) / 2))), 11.4157), 6.72611)) * -1)
//prepare panel data including vwap, high, low, open
def prepare66(data, startTime, endTime){
t = select securityid, tradetime, vwap, high, low, open from data where tradetime between startTime : endTime
return dict(`vwap`high`low`open, panel(t.tradetime, t.securityid, [t.vwap, t.high, t.low, t.open]))
}
//alpha 68
//((Ts_Rank(correlation(rank(high), rank(adv15), 8.91644), 13.9333) < rank(delta(((close * 0.518371) + (low * (1 - 0.518371))), 1.06157))) * -1)
//prepare panel data including vol, close, high, low
def prepare68(data, startTime, endTime){
t = select securityid, tradetime, vol, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.high, t.low]))
}
//alpha 71
//max(Ts_Rank(decay_linear(correlation(Ts_Rank(close, 3.43976), Ts_Rank(adv180, 12.0647), 18.0175), 4.20501), 15.6948), Ts_Rank(decay_linear((rank(((low + open) - (vwap + vwap)))^2), 16.4662), 4.4388))
//prepare panel data including vol, vwap, close, open, low
def prepare71(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, close, open, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`close`open`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.close, t.open, t.low]))
}
//alpha 72
//(rank(decay_linear(correlation(((high + low) / 2), adv40, 8.93345), 10.1519)) / rank(decay_linear(correlation(Ts_Rank(vwap, 3.72469), Ts_Rank(volume, 18.5188), 6.86671), 2.95011)))
//prepare panel data including vol, vwap, high, low
def prepare72(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, high, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`high`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.high, t.low]))
}
//alpha 73
//(max(rank(decay_linear(delta(vwap, 4.72775), 2.91864)), Ts_Rank(decay_linear(((delta(((open * 0.147155) + (low * (1 - 0.147155))), 2.03608) / ((open * 0.147155) + (low * (1 - 0.147155)))) * -1), 3.33829), 16.7411)) * -1)
//prepare panel data including vwap, open, low
def prepare73(data, startTime, endTime){
t = select securityid, tradetime, vwap, open, low from data where tradetime between startTime : endTime
return dict(`vwap`open`low, panel(t.tradetime, t.securityid, [t.vwap, t.open, t.low]))
}
//alpha 74
//((rank(correlation(close, sum(adv30, 37.4843), 15.1365)) < rank(correlation(rank(((high * 0.0261661) + (vwap * (1 - 0.0261661)))), rank(volume), 11.4791))) * -1)
//prepare panel data including vol, vwap, close, high
def prepare74(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, close, high from data where tradetime between startTime : endTime
return dict(`vol`vwap`close`high, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.close, t.high]))
}
//alpha 75
//(rank(correlation(vwap, volume, 4.24304)) < rank(correlation(rank(low), rank(adv50), 12.4413)))
//prepare panel data including vol, vwap, low
def prepare75(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.low]))
}
//alpha 77
//min(rank(decay_linear(((((high + low) / 2) + high) - (vwap + high)), 20.0451)), rank(decay_linear(correlation(((high + low) / 2), adv40, 3.1614), 5.64125)))
//prepare panel data including vol, vwap, high, low
def prepare77(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, high, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`high`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.high, t.low]))
}
//alpha 78
//(rank(correlation(sum(((low * 0.352233) + (vwap * (1 - 0.352233))), 19.7428), sum(adv40, 19.7428), 6.83313))^rank(correlation(rank(vwap), rank(volume), 5.77492)))
//prepare panel data including vol, vwap, low
def prepare78(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.low]))
}
//alpha 81
//((rank(Log(product(rank((rank(correlation(vwap, sum(adv10, 49.6054), 8.47743))^4)), 14.9655))) < rank(correlation(rank(vwap), rank(volume), 5.07914))) * -1)
//prepare panel data including vol, vwap
def prepare81(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap from data where tradetime between startTime : endTime
return dict(`vol`vwap, panel(t.tradetime, t.securityid, [t.vol, t.vwap]))
}
//alpha 83
//((rank(delay(((high - low) / (sum(close, 5) / 5)), 2)) * rank(rank(volume))) / (((high - low) / (sum(close, 5) / 5)) / (vwap - close)))
//prepare panel data including vol, vwap, close, high, low
def prepare83(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`vwap`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.close, t.high, t.low]))
}
//alpha 84
//SignedPower(Ts_Rank((vwap - ts_max(vwap, 15.3217)), 20.7127), delta(close, 4.96796))
//prepare panel data including vwap, close
def prepare84(data, startTime, endTime){
t = select securityid, tradetime, vwap, close from data where tradetime between startTime : endTime
return dict(`vwap`close, panel(t.tradetime, t.securityid, [t.vwap, t.close]))
}
//alpha 85
//(rank(correlation(((high * 0.876703) + (close * (1 - 0.876703))), adv30, 9.61331))^rank(correlation(Ts_Rank(((high + low) / 2), 3.70596), Ts_Rank(volume, 10.1595), 7.11408)))
//prepare panel data including vol, close, high, low
def prepare85(data, startTime, endTime){
t = select securityid, tradetime, vol, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.close, t.high, t.low]))
}
//alpha 86
//((Ts_Rank(correlation(close, sum(adv20, 14.7444), 6.00049), 20.4195) < rank(((open + close) - (vwap + open)))) * -1)
//prepare panel data including vol, vwap, open, close
def prepare86(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, open, close from data where tradetime between startTime : endTime
return dict(`vol`vwap`open`close, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.open, t.close]))
}
//alpha 88
//min(rank(decay_linear(((rank(open) + rank(low)) - (rank(high) + rank(close))), 8.06882)), Ts_Rank(decay_linear(correlation(Ts_Rank(close, 8.44728), Ts_Rank(adv60, 20.6966), 8.01266), 6.65053), 2.61957))
//prepare panel data including vol, open, close, high, low
def prepare88(data, startTime, endTime){
t = select securityid, tradetime, vol, open, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`open`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.open, t.close, t.high, t.low]))
}
//alpha 92
//min(Ts_Rank(decay_linear(((((high + low) / 2) + close) < (low + open)), 14.7221), 18.8683), Ts_Rank(decay_linear(correlation(rank(low), rank(adv30), 7.58555), 6.94024), 6.80584))
//prepare panel data including vol, open, close, high, low
def prepare92(data, startTime, endTime){
t = select securityid, tradetime, vol, open, close, high, low from data where tradetime between startTime : endTime
return dict(`vol`open`close`high`low, panel(t.tradetime, t.securityid, [t.vol, t.open, t.close, t.high, t.low]))
}
//alpha 94
//((rank((vwap - ts_min(vwap, 11.5783)))^Ts_Rank(correlation(Ts_Rank(vwap, 19.6462), Ts_Rank(adv60, 4.02992), 18.0926), 2.70756)) * -1)
//prepare panel data including vol, vwap
def prepare94(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap from data where tradetime between startTime : endTime
return dict(`vol`vwap, panel(t.tradetime, t.securityid, [t.vol, t.vwap]))
}
//alpha 95
//(rank((open - ts_min(open, 12.4105))) < Ts_Rank((rank(correlation(sum(((high + low) / 2), 19.1351), sum(adv40, 19.1351), 12.8742))^5), 11.7584))
//prepare panel data including vol, open, high, low
def prepare95(data, startTime, endTime){
t = select securityid, tradetime, vol, open, high, low from data where tradetime between startTime : endTime
return dict(`vol`open`high`low, panel(t.tradetime, t.securityid, [t.vol, t.open, t.high, t.low]))
}
//alpha 96
//(max(Ts_Rank(decay_linear(correlation(rank(vwap), rank(volume), 3.83878), 4.16783), 8.38151), Ts_Rank(decay_linear(Ts_ArgMax(correlation(Ts_Rank(close, 7.45404), Ts_Rank(adv60, 4.13242), 3.65459), 12.6556), 14.0365), 13.4143)) * -1)
//prepare panel data including vol, vwap, close
def prepare96(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, close from data where tradetime between startTime : endTime
return dict(`vol`vwap`close, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.close]))
}
//alpha 98
//(rank(decay_linear(correlation(vwap, sum(adv5, 26.4719), 4.58418), 7.18088)) - rank(decay_linear(Ts_Rank(Ts_ArgMin(correlation(rank(open), rank(adv15), 20.8187), 8.62571), 6.95668), 8.07206)))
//prepare panel data including vwap, volume, open
def prepare98(data, startTime, endTime){
t = select securityid, tradetime, vwap, vol, open from data where tradetime between startTime : endTime
return dict(`vwap`open`vol, panel(t.tradetime, t.securityid, [t.vwap, t.open, t.vol]))
}
//alpha 99
//((rank(correlation(sum(((high + low) / 2), 19.8975), sum(adv60, 19.8975), 8.8136)) < rank(correlation(low, volume, 6.28259))) * -1)
//prepare panel data including vol, high, low
def prepare99(data, startTime, endTime){
t = select securityid, tradetime, vol, high, low from data where tradetime between startTime : endTime
return dict(`vol`high`low, panel(t.tradetime, t.securityid, [t.vol, t.high, t.low]))
}
//alpha 101
//((close - open) / ((high - low) + .001))
//prepare panel data including close, open, high, low
def prepare101(data, startTime, endTime){
t = select securityid, tradetime, close, open, high, low from data where tradetime between startTime : endTime
return dict(`close`open`high`low, panel(t.tradetime, t.securityid, [t.close, t.open, t.high, t.low]))
}
//prepare factos with industry neutralization
//alpha 48
//(indneutralize(((correlation(delta(close, 1), delta(delay(close, 1), 1), 250) * delta(close, 1)) / close), IndClass.subindustry) / sum(((delta(close, 1) / delay(close, 1))^2), 250))
def prepare48(data, startTime, endTime){
t = select securityid, tradetime, close, indclass from data where tradetime between startTime : endTime
return dict(`close`indclass, panel(t.tradetime, t.securityid, [t.close, t.indclass]))
}
//alpha 56
//(0 - (1 * (rank((sum(returns, 10) / sum(sum(returns, 2), 3))) * rank((returns * cap)))))
def prepare56(data, startTime, endTime){
t = select securityid, tradetime, close, cap from data where tradetime between startTime : endTime
return dict(`close`cap, panel(t.tradetime, t.securityid, [t.close, t.cap]))
}
//alpha 58
//(-1 * Ts_Rank(decay_linear(correlation(IndNeutralize(vwap, IndClass.sector), volume, 3.92795), 7.89291), 5.50322))
def prepare58(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.indclass]))
}
//alpha 59
//(-1 * Ts_Rank(decay_linear(correlation(IndNeutralize(((vwap * 0.728317) + (vwap * (1 - 0.728317))), IndClass.industry), volume, 4.25197), 16.2289), 8.19648))
def prepare59(data, startTime, endTime){
t = select securityid, tradetime, vol, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.vwap, t.indclass]))
}
//alpha 63
//((rank(decay_linear(delta(IndNeutralize(close, IndClass.industry), 2.25164), 8.22237)) - rank(decay_linear(correlation(((vwap * 0.318108) + (open * (1 - 0.318108))), sum(adv180, 37.2467), 13.557), 12.2883))) * -1)
def prepare63(data, startTime, endTime){
t = select securityid, tradetime, vol, open, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`open`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.open, t.close, t.vwap, t.indclass]))
}
//alpha 67
//((rank((high - ts_min(high, 2.14593)))^rank(correlation(IndNeutralize(vwap, IndClass.sector), IndNeutralize(adv20, IndClass.subindustry), 6.02936))) * -1)
def prepare67(data, startTime, endTime){
t = select securityid, tradetime, vol, high, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`high`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.high, t.vwap, t.indclass]))
}
//alpha 69
//((rank(ts_max(delta(IndNeutralize(vwap, IndClass.industry), 2.72412), 4.79344))^Ts_Rank(correlation(((close * 0.490655) + (vwap * (1 - 0.490655))), adv20, 4.92416), 9.0615)) * -1)
def prepare69(data, startTime, endTime){
t = select securityid, tradetime, vol, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.close, t.vwap, t.indclass]))
}
//alpha 70
//((rank(delta(vwap, 1.29456))^Ts_Rank(correlation(IndNeutralize(close, IndClass.industry), adv50, 17.8256), 17.9171)) * -1)
def prepare70(data, startTime, endTime){
t = select securityid, tradetime, vol, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.close, t.vwap, t.indclass]))
}
//alpha 76
//(max(rank(decay_linear(delta(vwap, 1.24383), 11.8259)), Ts_Rank(decay_linear(Ts_Rank(correlation(IndNeutralize(low, IndClass.sector), adv81, 8.14941), 19.569), 17.1543), 19.383)) * -1)
def prepare76(data, startTime, endTime){
t = select securityid, tradetime, vol, low, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`low`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.low, t.vwap, t.indclass]))
}
//alpha 79
//(rank(delta(IndNeutralize(((close * 0.60733) + (open * (1 - 0.60733))), IndClass.sector), 1.23438)) < rank(correlation(Ts_Rank(vwap, 3.60973), Ts_Rank(adv150, 9.18637), 14.6644)))
def prepare79(data, startTime, endTime){
t = select securityid, tradetime, vol, open, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`open`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.open, t.close, t.vwap, t.indclass]))
}
//alpha 80
//((rank(Sign(delta(IndNeutralize(((open * 0.868128) + (high * (1 - 0.868128))), IndClass.industry), 4.04545)))^Ts_Rank(correlation(high, adv10, 5.11456), 5.53756)) * -1)
def prepare80(data, startTime, endTime){
t = select securityid, tradetime, vol, open, high, indclass from data where tradetime between startTime : endTime
return dict(`vol`open`high`indclass, panel(t.tradetime, t.securityid, [t.vol, t.open, t.high, t.indclass]))
}
//alpha 82
//(min(rank(decay_linear(delta(open, 1.46063), 14.8717)), Ts_Rank(decay_linear(correlation(IndNeutralize(volume, IndClass.sector), ((open * 0.634196) + (open * (1 - 0.634196))), 17.4842), 6.92131), 13.4283)) * -1)
def prepare82(data, startTime, endTime){
t = select securityid, tradetime, vol, open, indclass from data where tradetime between startTime : endTime
return dict(`vol`open`indclass, panel(t.tradetime, t.securityid, [t.vol, t.open, t.indclass]))
}
//alpha 87
//(max(rank(decay_linear(delta(((close * 0.369701) + (vwap * (1 - 0.369701))), 1.91233), 2.65461)), Ts_Rank(decay_linear(abs(correlation(IndNeutralize(adv81, IndClass.industry), close, 13.4132)), 4.89768), 14.4535)) * -1)
def prepare87(data, startTime, endTime){
t = select securityid, tradetime, vol, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.close, t.vwap, t.indclass]))
}
//alpha 89
//(Ts_Rank(decay_linear(correlation(((low * 0.967285) + (low * (1 - 0.967285))), adv10, 6.94279), 5.51607), 3.79744) - Ts_Rank(decay_linear(delta(IndNeutralize(vwap, IndClass.industry), 3.48158), 10.1466), 15.3012))
def prepare89(data, startTime, endTime){
t = select securityid, tradetime, vol, low, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`low`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.low, t.vwap, t.indclass]))
}
//alpha 90
//((rank((close - ts_max(close, 4.66719)))^Ts_Rank(correlation(IndNeutralize(adv40, IndClass.subindustry), low, 5.38375), 3.21856)) * -1)
def prepare90(data, startTime, endTime){
t = select securityid, tradetime, vol, low, close, indclass from data where tradetime between startTime : endTime
return dict(`vol`low`close`indclass, panel(t.tradetime, t.securityid, [t.vol, t.low, t.close, t.indclass]))
}
//alpha 91
//((Ts_Rank(decay_linear(decay_linear(correlation(IndNeutralize(close, IndClass.industry), volume, 9.74928), 16.398), 3.83219), 4.8667) - rank(decay_linear(correlation(vwap, adv30, 4.01303), 2.6809))) * -1)
def prepare91(data, startTime, endTime){
t = select securityid, tradetime, vol, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.close, t.vwap, t.indclass]))
}
//alpha 93
//(Ts_Rank(decay_linear(correlation(IndNeutralize(vwap, IndClass.industry), adv81, 17.4193), 19.848), 7.54455) / rank(decay_linear(delta(((close * 0.524434) + (vwap * (1 - 0.524434))), 2.77377), 16.2664)))
def prepare93(data, startTime, endTime){
t = select securityid, tradetime, vol, close, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`close`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.close, t.vwap, t.indclass]))
}
//alpha 97
//((rank(decay_linear(delta(IndNeutralize(((low * 0.721001) + (vwap * (1 - 0.721001))), IndClass.industry), 3.3705), 20.4523)) - Ts_Rank(decay_linear(Ts_Rank(correlation(Ts_Rank(low, 7.87871), Ts_Rank(adv60, 17.255), 4.97547), 18.5925), 15.7152), 6.71659)) * -1)
def prepare97(data, startTime, endTime){
t = select securityid, tradetime, vol, low, vwap, indclass from data where tradetime between startTime : endTime
return dict(`vol`low`vwap`indclass, panel(t.tradetime, t.securityid, [t.vol, t.low, t.vwap, t.indclass]))
}
//alpha 100
//(0 - (1 * (((1.5 * scale(indneutralize(indneutralize(rank(((((close - low) - (high - close)) / (high - low)) * volume)), IndClass.subindustry), IndClass.subindustry))) - scale(indneutralize((correlation(close, rank(adv20), 5) - rank(ts_argmin(close, 30))), IndClass.subindustry))) * (volume / adv20))))
def prepare100(data, startTime, endTime){
t = select securityid, tradetime, vol, high, low, close, indclass from data where tradetime between startTime : endTime
return dict(`vol`high`low`close`indclass, panel(t.tradetime, t.securityid, [t.vol, t.high, t.low, t.close, t.indclass]))
}
//3. Calculation helper functions.
def calAlpha1(data, startTime, endTime){
input = prepare1(data, startTime, endTime)
return wq101alpha::WQAlpha1(input)
}
def calAlpha2(data, startTime, endTime){
input = prepare2(data, startTime, endTime)
return wq101alpha::WQAlpha2(input.vol, input.close, input.open)
}
def calAlpha3(data, startTime, endTime){
input = prepare3(data, startTime, endTime)
return wq101alpha::WQAlpha3(input.vol, input.open)
}
def calAlpha4(data, startTime, endTime){
input = prepare4(data, startTime, endTime)
return wq101alpha::WQAlpha4(input)
}
def calAlpha5(data, startTime, endTime){
input = prepare5(data, startTime, endTime)
return wq101alpha::WQAlpha5(input.vwap, input.open, input.close)
}