温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,汇文网负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
网站客服:3074922707
rrquantC20
MC
inputs:
X(6),TRAILINGSTOPRATE(1),Fund(30000); ;
Vars:
JO(0),HL(0),Band(0), TMP1(0),TMP2(0), HCAfterEntry(0), LCAfterEntry(0),PriceSY(0),PriceBY(0),lots(0);
JO=openD(0);
lots=maxlist(1,IntPortion(Fund/(O*bigpointvalue*0.1)));
HL=maxlist(HighD(1)-closeD(1),closeD(1)-Lowd(1));
Band=Maxlist(JO*0.01,HL);
TMP1=JO+0.1*X*Band;
TMP2=JO-0.1*X*Band;
If MarketPosition=0 and close>=TMP1 and close[1]<TMP1 then buy("bk") lots shares next bar market;
If MarketPosition=0 and close<=TMP2 and close[1]>TMP2 then SellShort("SK") lots shares next bar market;
If MarketPosition=1 and close<=TMP2 then sell("SP") next bar market;
If MarketPosition=-1 and close>=TMP1 then BuyToCover ("BP") next bar market;
PriceSY=HCafterentry[1]-O*TRAILINGSTOPRATE*0.01;
If MarketPosition=1 and barssinceentry>1 and L<=PriceSY then sell ("SY")next bar PriceSY stop;
PriceBY=LCAfterEntry[1]+O*TRAILINGSTOPRATE*0.01;
If MarketPosition=-1 and barssinceentry>1 and H>=PriceBY then buytocover ("BY")next bar PriceBY stop;
If(BarsSinceentry = 0) then
begin
HCafterentry = C;
LCafterentry = C;
end
else begin
HCafterentry = maxlist(HCafterentry,H);
LCafterentry = Minlist(LCafterentry,L);
End