老師,圖表怎么修改編寫成后臺交易的 [金字塔]
- 咨詢內(nèi)容:
老師 請幫忙改一下,圖表交易的轉(zhuǎn)化為后臺交易的,應(yīng)該修改編寫
DIFF := EMA(CLOSE,360) - EMA(CLOSE,1440);
DEA := EMA(DIFF,160);
macd_M5:= 2*(DIFF-DEA);MA1:MA(C,60),COLORRED;
S:= ABS(MA1-H)<=12*mindiff;
n:=10;//加倉次數(shù)
x:=3;//建倉手?jǐn)?shù)
w:=5;kong:=S and macd_m5<0 ;
if kong then buyshort(holding=0,x,market);if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=2*x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=3*x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=4*x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=5*x then buyshort(1,x,market);
if macd_m5>0 and holding<0 then sellshort(1,0,market);//平空
- 金字塔客服:
前面的不變,后面的修改如下:
if kong then tbuyshort(tholding=0,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=2*x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=3*x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=4*x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=5*x then tbuyshort(1,x,mkt);
if macd_m5>0 and tholding<0 then tsellshort(1,0,mkt);//平空 - 用戶回復(fù):
老師 問下 后臺交易的 是在逐K線計算模式下 還是序列模式
- 網(wǎng)友回復(fù):
一般序列,除非有特殊的函數(shù),才會用到逐k
- 網(wǎng)友回復(fù): 老師 就上面那個策略,我放在后臺交易,為什么 會開倉了就馬上平倉
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容