分時圖交易策略
作者:金字塔 來源:cxh99.com 發(fā)布時間:2019年12月06日
-
咨詢內(nèi)容:
分時均線上開多
每盈利5個點平倉3分之1
每盈利10個點平倉3分之1
每盈利20個點平倉3分之1
如果分時均線向下?lián)舸┤科絺},
分時均線下開空
每盈利5個點平倉3分之1
每盈利10個點平倉3分之1
每盈利20個點平倉3分之1
如果分時均線出現(xiàn)向上擊穿,全部平倉
每天收盤全部平倉
?
-
金字塔客服:
你說的平掉三分之一,是指剩余的三分之一?還是什么?
?
?來源:程序化久久網(wǎng)( www.weiqiv.net.cn )
-
用戶回復(fù):
分三次平倉比如總建倉9手? 先平3手 再3手? 3手的平倉
?
-
網(wǎng)友回復(fù):
?1.先處理下分時均線http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=6285
n1:=todaybar;
dm:=4-INTPART(LOG(C));
結(jié)算價:ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm),colorred;
不過這個無法完全等效系統(tǒng)自帶的分時均線,但大體上是貼近的。
2.上下穿用cross函數(shù)
3.分段平倉。多頭為例。
if c-enterprice>=5 and holding>0 then begin
sell(holding>0,holding/3,market);
end
if c-enterprice>=10 and holding<0 then begin
sell(holding>0,holding/2,market);
end
if c-enterprice>=20 and holding<0 then begin
sell(holding>0,holding,market);
end
具體編寫細(xì)節(jié)你可以先自行嘗試下。
?
-
網(wǎng)友回復(fù):
//分時線數(shù)據(jù)?
n1:=todaybar;
dm:=4-INTPART(LOG(C));
結(jié)算價:ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm),colorred;
KD:=CROSS( C,結(jié)算價 );? ? ? ? ? //開多條件
if c-enterprice>=5 and holding>0 then begin
sell(holding>0,holding/3,market);
end
if c-enterprice>=10 and holding<0 then begin
sell(holding>0,holding/2,market);
end
if c-enterprice>=20 and holding<0 then begin
sell(holding>0,holding,market);
end;? ? ? ? ? //平多條件
KK:=CROSS( 結(jié)算價,C );? ? ? ? ? //開空條件
if c-enterprice>=-5 and holding>0 then begin
sell(holding>0,holding/3,market);
end
if c-enterprice=-10 and holding<0 then begin
sell(holding>0,holding/2,market);
end
if c-enterprice>=-20 and holding<0 then begin
sell(holding>0,holding,market);
end;? ? ? ? ? //平空條件
PK:=CROSS( 結(jié)算價,C );
PD:=CROSS( C,結(jié)算價 );?
平空:SELLSHORT(PK,9,THISCLOSE);? ? ? ? ? ? ? ? ? //平空信號
開多:BUY(KD AND HOLDING=0,9,THISCLOSE);? ? ? ? ? //開多信號
平多:SELL(PD,9,THISCLOSE);? ? ? ? ? ? ? ? ? ? ? ?//平多信號
開空:BUYSHORT(KK AND HOLDING=0,9,THISCLOSE);? ? ?//開空信號
幫我修改下,平倉都是一次性平倉的,改成分批平倉的