53歳限界プログラマの憂鬱

SU/CAR-ST-APplication-cellsから派生したプログラマのブログ

来訪ありがとうございます
シストレツールを自作してました
自分用の記事が多いのであまり役には立たないブログでした

f:id:sucar:20150414193802p:plain

自作システム詳細目次

R_NOW_IMP.m4にexportされるrule(9-12)

suR1/rule9.R

2019/7/27追加)

 

#暫定1号
#25日移動平均乖離率が小さい順の下から0.1%
#
if (lmt==0) {lmt<-10}
#
s$h25<-hei25(s) ans<-tapply(s$h25,s$j,quantile,0.001,na.rm=TRUE) ans0<-hei(ans,10) q <- subset(s , #M525 s5m(sp0m)+5*s25m(sp0m)<(-10) & # h25<ans0[j+1]& ##h25< (-20)& h25< (-20)& dai>100000000& TRUE ) #ソートしていないので猿ダーツ index<-tapply(-q$dai,q$j,order) ans<-NULL for (i in 1:length(index)) { ans<-c(ans,index[ [i] ]) } q$ord<-ans p<-subset(q,ord<=lmt) #p<-q rm(q) #-5%で指値5日後引け成り売り kai_k<- 5.0 uri_k<- 6.0 kai<-0 uri<-3 kap<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8) urp<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8)

となってる

無駄な部分もあるが、壊すといけないので整理はせずこのまま

 バックテスト

f:id:sucar:20190629135521p:plain

最近好調!

 suR1/rule10.R

#暫定2号
#75日移動平均乖離率が小さい順の下から0.1%
#
if (lmt==0) {lmt<-10}
#
s$h75<-hei75(s) ans<-tapply(s$h75,s$j,quantile,0.001,na.rm=TRUE) ans0<-hei(ans,10) q <- subset(s , #M575 s5m(sp0m)+5*s75m(sp0m)<(10) & # h75<ans0[j+1]& h75< (-30)& ##h75< (-25)& dai>100000000& TRUE ) #ソートしていないので猿ダーツ index<-tapply(-q$dai,q$j,order) ans<-NULL for (i in 1:length(index)) { ans<-c(ans,index[ [i] ]) } q$ord<-ans p<-subset(q,ord<=lmt) #p<-q rm(q) #-5%で指値5日後引け成り売り kai_k<- 5.0 uri_k<- 6.0 kai<-0 uri<-3 kap<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8) urp<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8)

バックテスト

f:id:sucar:20190629135843p:plain

これもいい感じ

 suR1/rule11.R

#暫定3号
#125日移動平均乖離率が小さい順の下から0.1%
#
if (lmt==0) {lmt<-10}
#
s$h125<-hei125(s) ans<-tapply(s$h125,s$j,quantile,0.001,na.rm=TRUE) ans0<-hei(ans,10) q <- subset(s , #M5125 s5m(sp0m)+5*s125m(sp0m)<(-10) & # h125<ans0[j+1]& ##h125< (-25)& h125< (-30)& dai>100000000& TRUE ) #ソートしていないので猿ダーツ index<-tapply(-q$dai,q$j,order) ans<-NULL for (i in 1:length(index)) { ans<-c(ans,index[ [i] ]) } q$ord<-ans p<-subset(q,ord<=lmt) #p<-q rm(q) #-5%で指値5日後引け成り売り kai_k<- 5.0 uri_k<- 6.0 kai<-0 uri<-3 kap<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8) urp<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8)

バックテスト

f:id:sucar:20190629140024p:plain

これもいい感じ

 suR1/rule12.R

#暫定4号
#15日移動平均乖離率が小さい順の下から0.1%
#
if (lmt==0) {lmt<-10}
#
s$h15<-hei15(s) ans<-tapply(s$h15,s$j,quantile,0.001,na.rm=TRUE) ans0<-hei(ans,10) q <- subset(s , #M515 s5m(sp0m)+5*s15m(sp0m)<(-10) & # h15<ans0[j+1]& ##h15< (-15)& h15< (-15)& dai>100000000& TRUE ) #ソートしていないので猿ダーツ index<-tapply(-q$dai,q$j,order) ans<-NULL for (i in 1:length(index)) { ans<-c(ans,index[ [i] ]) } q$ord<-ans p<-subset(q,ord<=lmt) #p<-q rm(q) #-5%で指値5日後引け成り売り kai_k<- 5.0 uri_k<- 6.0 kai<-0 uri<-3 kap<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8) urp<- abs((p$owa0-p$h10j0)/p$h10j0*100.0*0.8)

バックテスト

f:id:sucar:20190629140251p:plain

これも好調