請(qǐng)老師修改公式
作者:金字塔 來源:cxh99.com 發(fā)布時(shí)間:2016年12月05日
- 咨詢內(nèi)容:
input:n(1,1,100);input:x(1,1,100);if todaybar>1 and h>ref(c,todaybar)*1.1 then tbuy(1,n%,mkt),pertrader;if tbuyholding(0)>0 and (tenterprice-c)/tenterprice>=x/100 then tsell(1,0,mkt)
請(qǐng)老師把上面的公式修改成圖表程序化策略,滿足以下2個(gè)條件,1:自己選可能漲停板的股股票,2:用手?jǐn)?shù)買入并且手?jǐn)?shù)可調(diào).
- 金字塔客服:
可能漲停的條件和賣出條件如上面公式不變。
- 用戶回復(fù):
input:n(1,1,100);
input:x(1,1,100);
if todaybar>1 and h>ref(c,todaybar)*1.1 then buy(1,n,market);
if holding>0 and (enterprice-c)/enterprice>=x/100 then sell(1,0,market);
- 網(wǎng)友回復(fù):
請(qǐng)老師再看看剛修改的公式不會(huì)成交,如002778剛漲停,我也做模擬了,沒成交,我只買股票。
- 網(wǎng)友回復(fù):
input:n(1,1,100);
input:x(1,1,100);
if todaybar>1 and h>=ref(c,todaybar)*1.09 then buy(1,n,market);
if holding>0 and (enterprice-c)/enterprice>=x/100 then sell(1,0,market);
大概是這樣,因?yàn)閳D表里面不能直接用漲停價(jià),所以用一個(gè)近似算法來算漲停價(jià)