相关标签:惠比特交易和配种专区,梦三国交易专区,梦三国交易专区速秒,灵缇格力交易专区,中京交易市场下载专区,古币银元交易专区,长毛德牧交易专区,梦三国交易专区在哪里,qq交易专区,
模型策略源码:runmode:0; input:length1(60); input:length2(30); variable:myholding=0; variable:myprofit=0; variable:myentryprice=0; variable:myexitprice=0; variable:myfailtrade=0; entryupperband:=ref(hhv(high,length1),1); entrylowerband:=ref(llv(low,length1),1); entrylongcond:=high>=entryupperband; entryshortcond:=low<=entrylowerband; exitupperband:=ref(hhv(high,length2),1); exitlowerband:=ref(llv(low,length2),1); exitlongcond:=low<=exitlowerband; exitshortcond:=high>=exitupperband; if myholding=0 then begin if entrylongcond then begin myholding:=1; myentryprice:=max(open,entryupperband); end end if myholding=0 then begin if entryshortcond then begin myholding:=2; myentryprice:=min(open,entrylowerband); end end if myholding=1 then begin if exitlongcond then begin myholding:=0; myexitprice:=min(open,exitlowerband); myprofit:=myexitprice-myentryprice; if myprofit<0 then myfailtrade:=myfailtrade+1; else myfailtrade:=0; end end if myholding=2 then begin if exitshortcond then begin myholding:=0; myexitprice:=max(open,exitupperband); myprofit:=myentryprice-myexitprice; if myprofit<0 then myfailtrade:=myfailtrade+1; else myfailtrade:=0; end end if holding=0 and myfailtrade=1 then begin if entrylongcond then buy(1,1,limitr,max(open,entryupperband)); end if holding=0 and myfailtrade=1 then begin if entryshortcond then buyshort(1,1,limitr,min(open,entrylowerband)); end if holding>0 then begin if exitlongcond then sell(1,holding,limitr,min(open,exitlowerband)); end if holding<0 then begin if exitshortcond then sellshort(1,holding,limitr,max(open,exitupperband)); end 盈亏:asset-50000,noaxis,colorred,linethick2; 点击复制上述代码粘贴到到公式管理器
{别忘了将本网告诉您身边的朋友,向朋友传达有用资料,也是一种人情,你朋友会感谢你的。}