相關(guān)標(biāo)簽:惠比特交易和配種專區(qū),夢三國交易專區(qū),夢三國交易專區(qū)速秒,靈緹格力交易專區(qū),中京交易市場下載專區(qū),古幣銀元交易專區(qū),長毛德牧交易專區(qū),夢三國交易專區(qū)在哪里,qq交易專區(qū),
模型策略源碼: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; 點(diǎn)擊復(fù)制上述代碼粘貼到到公式管理器
{別忘了將本網(wǎng)告訴您身邊的朋友,向朋友傳達(dá)有用資料,也是一種人情,你朋友會感謝你的。}