k線結(jié)束前執(zhí)行 [金字塔]
- 咨詢內(nèi)容:
看了阿火的帖子,
abb:=(time0-timetot0(dynainfo(207))<=5) or not(islastbar);
if abb then begin
end這個(gè)條件覺得不太對,
if holding>0 and ma5<ma10 then sell(1,1,thisclose);
if holding<0 and ma5>ma10 then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 then buy(1,1,thisclose);
if holding=0 and ma5<ma10 then buyshort(1,1,thisclose);
這段代碼開平倉執(zhí)行的時(shí)機(jī)是:如果當(dāng)前k線是當(dāng)天最后一根k線并且在收盤前5秒,或者當(dāng)前k線不是最后一根k線,下面的開平倉就會(huì)被固定時(shí)間去執(zhí)行 - 金字塔客服:
如果想要實(shí)現(xiàn),在每根k線都提前5秒執(zhí)行不應(yīng)該用上述條件吧
- 用戶回復(fù):
是這個(gè)abb的條件和開平倉條件滿足就會(huì)提前5秒下單
- 網(wǎng)友回復(fù):
abb:=(time0-timetot0(dynainfo(207))<=5) or not(islastbar);
只要islastbar=0, abb就會(huì)等于1,而islastbar=0不就是說當(dāng)前的k線不是最后一根k線嗎
也就是說只要當(dāng)前不是最后一根k線開平倉的判斷與執(zhí)行就會(huì)在每次固定間隔時(shí)間去執(zhí)行,而不是k線的最后5秒。我上面的理解有什么問題嗎 - 網(wǎng)友回復(fù):
不是的
not(islastbar)是保留歷史信號(hào)用的,
(time0-timetot0(dynainfo(207))<=5)是判斷當(dāng)前k離走完k線是否<=5秒
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容