6 Star 18 Fork 4

浙江智臾科技有限公司 / DolphinDBModules

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
prepare101.dos 59.68 KB
一键复制 编辑 原始数据 按行查看 历史
jiajiaxu123 提交于 2023-05-16 11:24 . update wq101alpha
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573
/* *
* @ 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)
}
def calAlpha6(data, startTime, endTime){
input = prepare6(data, startTime, endTime)
return wq101alpha::WQAlpha6(input.vol, input.open)
}
def calAlpha7(data, startTime, endTime){
input = prepare7(data, startTime, endTime)
return wq101alpha::WQAlpha7(input.vol, input.close)
}
def calAlpha8(data, startTime, endTime){
input = prepare8(data, startTime, endTime)
return wq101alpha::WQAlpha8(input.open, input.close)
}
def calAlpha9(data, startTime, endTime){
input = prepare9(data, startTime, endTime)
return wq101alpha::WQAlpha9(input)
}
def calAlpha10(data, startTime, endTime){
input = prepare10(data, startTime, endTime)
return wq101alpha::WQAlpha10(input)
}
def calAlpha11(data, startTime, endTime){
input = prepare11(data, startTime, endTime)
return wq101alpha::WQAlpha11(input.vwap, input.vol, input.close)
}
def calAlpha12(data, startTime, endTime){
input = prepare12(data, startTime, endTime)
return wq101alpha::WQAlpha12(input.vol, input.close)
}
def calAlpha13(data, startTime, endTime){
input = prepare13(data, startTime, endTime)
return wq101alpha::WQAlpha13(input.vol, input.close)
}
def calAlpha14(data, startTime, endTime){
input = prepare14(data, startTime, endTime)
return wq101alpha::WQAlpha14(input.vol, input.open, input.close)
}
def calAlpha15(data, startTime, endTime){
input = prepare15(data, startTime, endTime)
return wq101alpha::WQAlpha15(input.vol, input.high)
}
def calAlpha16(data, startTime, endTime){
input = prepare16(data, startTime, endTime)
return wq101alpha::WQAlpha16(input.vol, input.high)
}
def calAlpha17(data, startTime, endTime){
input = prepare17(data, startTime, endTime)
return wq101alpha::WQAlpha17(input.vol, input.close)
}
def calAlpha18(data, startTime, endTime){
input = prepare18(data, startTime, endTime)
return wq101alpha::WQAlpha18(input.close, input.open)
}
def calAlpha19(data, startTime, endTime){
input = prepare19(data, startTime, endTime)
return wq101alpha::WQAlpha19(input)
}
def calAlpha20(data, startTime, endTime){
input = prepare20(data, startTime, endTime)
return wq101alpha::WQAlpha20(input.open, input.close, input.high, input.low)
}
def calAlpha21(data, startTime, endTime){
input = prepare21(data, startTime, endTime)
return wq101alpha::WQAlpha21(input.close, input.vol)
}
def calAlpha22(data, startTime, endTime){
input = prepare22(data, startTime, endTime)
return wq101alpha::WQAlpha22(input.close, input.vol, input.high)
}
def calAlpha23(data, startTime, endTime){
input = prepare23(data, startTime, endTime)
return wq101alpha::WQAlpha23(input)
}
def calAlpha24(data, startTime, endTime){
input = prepare24(data, startTime, endTime)
return wq101alpha::WQAlpha24(input)
}
def calAlpha25(data, startTime, endTime){
input = prepare25(data, startTime, endTime)
return wq101alpha::WQAlpha25(input.close, input.vol, input.high, input.vwap)
}
def calAlpha26(data, startTime, endTime){
input = prepare26(data, startTime, endTime)
return wq101alpha::WQAlpha26(input.vol, input.high)
}
def calAlpha27(data, startTime, endTime){
input = prepare27(data, startTime, endTime)
return wq101alpha::WQAlpha27(input.vol, input.vwap)
}
def calAlpha28(data, startTime, endTime){
input = prepare28(data, startTime, endTime)
return wq101alpha::WQAlpha28(input.vol, input.high, input.low, input.close)
}
def calAlpha29(data, startTime, endTime){
input = prepare29(data, startTime, endTime)
return wq101alpha::WQAlpha29(input)
}
def calAlpha30(data, startTime, endTime){
input = prepare30(data, startTime, endTime)
return wq101alpha::WQAlpha30(input.vol, input.close)
}
def calAlpha31(data, startTime, endTime){
input = prepare31(data, startTime, endTime)
return wq101alpha::WQAlpha31(input.vol, input.close, input.low)
}
def calAlpha32(data, startTime, endTime){
input = prepare32(data, startTime, endTime)
return wq101alpha::WQAlpha32(input.close, input.vwap)
}
def calAlpha33(data, startTime, endTime){
input = prepare33(data, startTime, endTime)
return wq101alpha::WQAlpha33(input.open, input.close)
}
def calAlpha34(data, startTime, endTime){
input = prepare34(data, startTime, endTime)
return wq101alpha::WQAlpha34(input)
}
def calAlpha35(data, startTime, endTime){
input = prepare35(data, startTime, endTime)
return wq101alpha::WQAlpha35(input.vol, input.close, input.high, input.low)
}
def calAlpha36(data, startTime, endTime){
input = prepare36(data, startTime, endTime)
return wq101alpha::WQAlpha36(input.vol, input.open, input.close, input.vwap)
}
def calAlpha37(data, startTime, endTime){
input = prepare37(data, startTime, endTime)
return wq101alpha::WQAlpha37(input.open, input.close)
}
def calAlpha38(data, startTime, endTime){
input = prepare38(data, startTime, endTime)
return wq101alpha::WQAlpha38(input.open, input.close)
}
def calAlpha39(data, startTime, endTime){
input = prepare39(data, startTime, endTime)
return wq101alpha::WQAlpha39(input.vol, input.close)
}
def calAlpha40(data, startTime, endTime){
input = prepare40(data, startTime, endTime)
return wq101alpha::WQAlpha40(input.vol, input.high)
}
def calAlpha41(data, startTime, endTime){
input = prepare41(data, startTime, endTime)
return wq101alpha::WQAlpha41(input.high, input.low, input.vwap)
}
def calAlpha42(data, startTime, endTime){
input = prepare42(data, startTime, endTime)
return wq101alpha::WQAlpha42(input.vwap, input.close)
}
def calAlpha43(data, startTime, endTime){
input = prepare43(data, startTime, endTime)
return wq101alpha::WQAlpha43(input.vol, input.close)
}
def calAlpha44(data, startTime, endTime){
input = prepare44(data, startTime, endTime)
return wq101alpha::WQAlpha44(input.vol, input.high)
}
def calAlpha45(data, startTime, endTime){
input = prepare45(data, startTime, endTime)
return wq101alpha::WQAlpha45(input.vol, input.close)
}
def calAlpha46(data, startTime, endTime){
input = prepare46(data, startTime, endTime)
return wq101alpha::WQAlpha46(input)
}
def calAlpha47(data, startTime, endTime){
input = prepare47(data, startTime, endTime)
return wq101alpha::WQAlpha47(input.vol, input.close, input.high, input.vwap)
}
def calAlpha48(data, startTime, endTime){
input = prepare48(data, startTime, endTime)
return wq101alpha::WQAlpha48(input.close, input.indclass)
}
def calAlpha49(data, startTime, endTime){
input = prepare49(data, startTime, endTime)
return wq101alpha::WQAlpha49(input)
}
def calAlpha50(data, startTime, endTime){
input = prepare50(data, startTime, endTime)
return wq101alpha::WQAlpha50(input.vol, input.vwap)
}
def calAlpha51(data, startTime, endTime){
input = prepare51(data, startTime, endTime)
return wq101alpha::WQAlpha51(input)
}
def calAlpha52(data, startTime, endTime){
input = prepare52(data, startTime, endTime)
return wq101alpha::WQAlpha52(input.vol, input.close, input.low)
}
def calAlpha53(data, startTime, endTime){
input = prepare53(data, startTime, endTime)
return wq101alpha::WQAlpha53(input.close, input.high, input.low)
}
def calAlpha54(data, startTime, endTime){
input = prepare54(data, startTime, endTime)
return wq101alpha::WQAlpha54(input.open, input.close, input.high, input.low)
}
def calAlpha55(data, startTime, endTime){
input = prepare55(data, startTime, endTime)
return wq101alpha::WQAlpha55(input.vol, input.close, input.high, input.low)
}
def calAlpha56(data, startTime, endTime){
input = prepare56(data, startTime, endTime)
return wq101alpha::WQAlpha56(input.close, input.cap)
}
def calAlpha57(data, startTime, endTime){
input = prepare57(data, startTime, endTime)
return wq101alpha::WQAlpha57(input.close, input.vwap)
}
def calAlpha58(data, startTime, endTime){
input = prepare58(data, startTime, endTime)
return wq101alpha::WQAlpha58(input.vol, input.vwap, input.indclass)
}
def calAlpha59(data, startTime, endTime){
input = prepare59(data, startTime, endTime)
return wq101alpha::WQAlpha59(input.vol, input.vwap, input.indclass)
}
def calAlpha60(data, startTime, endTime){
input = prepare60(data, startTime, endTime)
return wq101alpha::WQAlpha60(input.vol, input.close, input.high, input.low)
}
def calAlpha61(data, startTime, endTime){
input = prepare61(data, startTime, endTime)
return wq101alpha::WQAlpha61(input.vol, input.vwap)
}
def calAlpha62(data, startTime, endTime){
input = prepare62(data, startTime, endTime)
return wq101alpha::WQAlpha62(input.vol, input.vwap, input.open, input.high, input.low)
}
def calAlpha63(data, startTime, endTime){
input = prepare63(data, startTime, endTime)
return wq101alpha::WQAlpha63(input.vol, input.open, input.close, input.vwap, input.indclass)
}
def calAlpha64(data, startTime, endTime){
input = prepare64(data, startTime, endTime)
return wq101alpha::WQAlpha64(input.vol, input.vwap, input.open, input.high, input.low)
}
def calAlpha65(data, startTime, endTime){
input = prepare65(data, startTime, endTime)
return wq101alpha::WQAlpha65(input.vol, input.vwap, input.open)
}
def calAlpha66(data, startTime, endTime){
input = prepare66(data, startTime, endTime)
return wq101alpha::WQAlpha66(input.vwap, input.high, input.low, input.open)
}
def calAlpha67(data, startTime, endTime){
input = prepare67(data, startTime, endTime)
return wq101alpha::WQAlpha67(input.vol, input.high, input.vwap, input.indclass)
}
def calAlpha68(data, startTime, endTime){
input = prepare68(data, startTime, endTime)
return wq101alpha::WQAlpha68(input.vol, input.close, input.high, input.low)
}
def calAlpha69(data, startTime, endTime){
input = prepare69(data, startTime, endTime)
return wq101alpha::WQAlpha69(input.vol, input.close, input.vwap, input.indclass)
}
def calAlpha70(data, startTime, endTime){
input = prepare70(data, startTime, endTime)
return wq101alpha::WQAlpha70(input.vol, input.close, input.vwap, input.indclass)
}
def calAlpha71(data, startTime, endTime){
input = prepare71(data, startTime, endTime)
return wq101alpha::WQAlpha71(input.vol, input.vwap, input.close, input.open, input.low)
}
def calAlpha72(data, startTime, endTime){
input = prepare72(data, startTime, endTime)
return wq101alpha::WQAlpha72(input.vol, input.vwap, input.high, input.low)
}
def calAlpha73(data, startTime, endTime){
input = prepare73(data, startTime, endTime)
return wq101alpha::WQAlpha73(input.vwap, input.open, input.low)
}
def calAlpha74(data, startTime, endTime){
input = prepare74(data, startTime, endTime)
return wq101alpha::WQAlpha74(input.vol, input.vwap, input.close, input.high)
}
def calAlpha75(data, startTime, endTime){
input = prepare75(data, startTime, endTime)
return wq101alpha::WQAlpha75(input.vol, input.vwap, input.low)
}
def calAlpha76(data, startTime, endTime){
input = prepare76(data, startTime, endTime)
return wq101alpha::WQAlpha76(input.vol, input.low, input.vwap, input.indclass)
}
def calAlpha77(data, startTime, endTime){
input = prepare77(data, startTime, endTime)
return wq101alpha::WQAlpha77(input.vol, input.vwap, input.high, input.low)
}
def calAlpha78(data, startTime, endTime){
input = prepare78(data, startTime, endTime)
return wq101alpha::WQAlpha78(input.vol, input.vwap, input.low)
}
def calAlpha79(data, startTime, endTime){
input = prepare79(data, startTime, endTime)
return wq101alpha::WQAlpha79(input.vol, input.open, input.close, input.vwap, input.indclass)
}
def calAlpha80(data, startTime, endTime){
input = prepare80(data, startTime, endTime)
return wq101alpha::WQAlpha80(input.vol, input.open, input.high, input.indclass)
}
def calAlpha81(data, startTime, endTime){
input = prepare81(data, startTime, endTime)
return wq101alpha::WQAlpha81(input.vol, input.vwap)
}
def calAlpha82(data, startTime, endTime){
input = prepare82(data, startTime, endTime)
return wq101alpha::WQAlpha82(input.vol, input.open, input.indclass)
}
def calAlpha83(data, startTime, endTime){
input = prepare83(data, startTime, endTime)
return wq101alpha::WQAlpha83(input.vol, input.vwap, input.close, input.high, input.low)
}
def calAlpha84(data, startTime, endTime){
input = prepare84(data, startTime, endTime)
return wq101alpha::WQAlpha84(input.vwap, input.close)
}
def calAlpha85(data, startTime, endTime){
input = prepare85(data, startTime, endTime)
return wq101alpha::WQAlpha85(input.vol, input.close, input.high, input.low)
}
def calAlpha86(data, startTime, endTime){
input = prepare86(data, startTime, endTime)
return wq101alpha::WQAlpha86(input.vol, input.vwap, input.open, input.close)
}
def calAlpha87(data, startTime, endTime){
input = prepare87(data, startTime, endTime)
return wq101alpha::WQAlpha87(input.vol, input.close, input.vwap, input.indclass)
}
def calAlpha88(data, startTime, endTime){
input = prepare88(data, startTime, endTime)
return wq101alpha::WQAlpha88(input.vol, input.open, input.close, input.high, input.low)
}
def calAlpha89(data, startTime, endTime){
input = prepare89(data, startTime, endTime)
return wq101alpha::WQAlpha89(input.vol, input.low, input.vwap, input.indclass)
}
def calAlpha90(data, startTime, endTime){
input = prepare90(data, startTime, endTime)
return wq101alpha::WQAlpha90(input.vol, input.low, input.close, input.indclass)
}
def calAlpha91(data, startTime, endTime){
input = prepare91(data, startTime, endTime)
return wq101alpha::WQAlpha91(input.vol, input.close, input.vwap, input.indclass)
}
def calAlpha92(data, startTime, endTime){
input = prepare92(data, startTime, endTime)
return wq101alpha::WQAlpha92(input.vol, input.open, input.close, input.high, input.low)
}
def calAlpha93(data, startTime, endTime){
input = prepare93(data, startTime, endTime)
return wq101alpha::WQAlpha93(input.vol, input.close, input.vwap, input.indclass)
}
def calAlpha94(data, startTime, endTime){
input = prepare94(data, startTime, endTime)
return wq101alpha::WQAlpha94(input.vol, input.vwap)
}
def calAlpha95(data, startTime, endTime){
input = prepare95(data, startTime, endTime)
return wq101alpha::WQAlpha95(input.vol, input.open, input.high, input.low)
}
def calAlpha96(data, startTime, endTime){
input = prepare96(data, startTime, endTime)
return wq101alpha::WQAlpha96(input.vol, input.vwap, input.close)
}
def calAlpha97(data, startTime, endTime){
input = prepare97(data, startTime, endTime)
return wq101alpha::WQAlpha97(input.vol, input.low, input.vwap, input.indclass)
}
def calAlpha98(data, startTime, endTime){
input = prepare98(data, startTime, endTime)
return wq101alpha::WQAlpha98(input.vwap, input.open, input.vol)
}
def calAlpha99(data, startTime, endTime){
input = prepare99(data, startTime, endTime)
return wq101alpha::WQAlpha99(input.vol, input.high, input.low)
}
def calAlpha100(data, startTime, endTime){
input = prepare100(data, startTime, endTime)
return wq101alpha::WQAlpha100(input.vol, input.high, input.low, input.close, input.indclass)
}
def calAlpha101(data, startTime, endTime){
input = prepare101(data, startTime, endTime)
return wq101alpha::WQAlpha101(input.close, input.open, input.high, input.low)
}
1
https://gitee.com/dolphindb/DolphinDBModules.git
git@gitee.com:dolphindb/DolphinDBModules.git
dolphindb
DolphinDBModules
DolphinDBModules
master

搜索帮助