如何编写符合条件不执行:不开多和不开空不执行 [金字塔]
- 咨询内容:
INPUT:SS(1,1,10000,10);手数:=SS;N:=BARSLAST(DATE<>REF(DATE,1));昨高:=CALLSTOCK(STKLABEL,VTHIGH,6,-1);//昨高昨低:=CALLSTOCK(STKLABEL,VTLOW,6,-1);//昨低昨收:=CALLSTOCK(STKLABEL,VTCLOSE,6,-1);//昨收A:=HHV(H,N+1);B:=LLV(L,N+1);观察卖出价:昨高+0.35*(昨收-昨低);//SSETUP反转卖出价:(1.07/2)*(昨高+昨低)-0.07*昨低;//SENTER反转买入价:(1.07/2)*(昨高+昨低)-0.07*昨高;//BENTER观察买入价:昨低-0.35*(昨高-昨收);//BSETUP突破买入价:(观察卖出价+0.25*(观察卖出价-观察买入价));//BBREEAK突破卖出价:观察买入价-0.25*(观察卖出价-观察买入价);//SBREAK
MACD4:EMA(CLOSE,("MACD.MACD"(26,12,3))*3);
手数:=SS;
DIFF : =EMA(CLOSE,S) - EMA(CLOSE,P);DEA : =EMA(DIFF,M);MACD1 := 2*(DIFF-DEA), COLORSTICK;
LC:=REF(CLOSE,1),NOAXIS;RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,NOAXIS; 顶部雷达:=CROSS(80,RSI)*30,LINETHICK2 ,colorgreen,NOAXIS; DRAWTEXT(CROSS(80,RSI),30,'见顶 '),colorgreen,NOAXIS; Varb:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100,NOAXIS; Varc:=SMA(MAX(CLOSE-LC,0),13,1)/SMA(ABS(CLOSE-LC),13,1)*100,NOAXIS; Vard:=BARSCOUNT(CLOSE),NOAXIS; 底部雷达:=(Varb< 20 AND Varc< 25 AND Vard> 50)*30,linethick2, colorff9933,NOAXIS;DRAWTEXT(CROSS(100,底部雷达) ,20,'底 '),linethick1,COLORF00FF0,NOAXIS;主力:=EMA( (CLOSE-MA(CLOSE,7))/MA(CLOSE,7)*480,2),linethick2 ,COLORRED,NOAXIS; 散户:=EMA( (CLOSE-MA(CLOSE,11))/MA(CLOSE,11)*480,7),linethick2 ,COLORWHITE,NOAXIS; DRAWTEXT(CROSS(主力,散户) AND 主力<-10,-20,'升'),color00ccff,NOAXIS; DRAWICON(CROSS(主力,散户) AND 主力<-10 AND 散户>REF(散户,1)OR CROSS(主力,散户) AND 散户<-35 ,-15,1),NOAXIS;DRAWTEXT(CROSS(18,RSI)AND 散户<-20 AND 底部雷达 ,25,'底 '),linethick1, COLORF00FF0,NOAXIS;MAV:=(2*C+H+L)/4,NOAXIS; Var1:=LLV(LOW,4),NOAXIS; Var2:=HHV(HIGH,7),NOAXIS; SK:=EMA((MAV-Var1)/(Var2-Var1)*100,13),NOAXIS; SD:=EMA(0.667*REF(SK,1)+0.333*SK,2),NOAXIS; 持仓:=STICKLINE(SK> SD,6,0,1,0) ,linethick3, COLORYELLOW,NOAXIS; 空仓:=STICKLINE(SK< SD,6,0,1,0) ,linethick3, color009900,NOAXIS; 正负量比:=12*(winner(c)-winner(o)) ,linethick2 ,colorstick,NOAXIS; 时空分裂点:=STICKLINE(100*v/capital>= 3 and 100*v/capital<7,100*v/capital,15,7,0),linethick2, COLORff3399,NOAXIS; STICKLINE(MACD1>0,OPEN,CLOSE,4,0,COLORRED); STICKLINE(MACD1<0,OPEN,CLOSE,4,0,COLORGREEN);
//顺序必须主要需要根据仓位先平后开的原则平多仓条件:=主力<0 AND 正负量比<0 AND MACD1<0;开多仓条件:=主力>0 AND 正负量比>0 AND MACD1>0;平空仓条件:=主力>0 AND 正负量比>0 AND MACD1>0;开空仓条件:=主力<0 AND 正负量比<0 AND MACD1<0;不开多:=观察买入价<c AND c>突破卖出价;不开空:=观察买入价<c AND c>突破卖出价;IF 不开多 THEN BEGINEXIT 开多:BUY(开多仓条件 AND HOLDING<=0,10,MARKET,C);EXIT 平空:SELLSHORT(平空仓条件 AND HOLDING<0,10,MARKET,C);ENDIF 不开空 THEN BEGINEXIT 开空:BUYSHORT(开空仓条件 AND HOLDING>=0,10,MARKET,C);EXIT 平多:SELL(平多仓条件 AND HOLDING>0,10,MARKET,C);END平空:SELLSHORT(平空仓条件 AND HOLDING<0,10,MARKET,C);平多:SELL(平多仓条件 AND HOLDING>0,10,MARKET,C);开空:BUYSHORT(开空仓条件 AND HOLDING>=0,10,MARKET,C);开多:BUY(开多仓条件 AND HOLDING<=0,10,MARKET,C);
- 金字塔客服:
满足条件然后不开空不开多?
那你把开空开多条件给限定一下
开多开空条件增加一个 不满足特定条件
- 用户回复:
请问用什么函数表达
- 网友回复:
平多仓条件:=主力<0 AND 正负量比<0 AND MACD1<0;
开多仓条件:=主力>0 AND 正负量比>0 AND MACD1>0;
平空仓条件:=主力>0 AND 正负量比>0 AND MACD1>0;
开空仓条件:=主力<0 AND 正负量比<0 AND MACD1<0;
不开多:=观察买入价<c AND c>突破卖出价;
不开空:=观察买入价<c AND c>突破卖出价;
IF 不开多 THEN BEGIN
EXIT 开多:BUY(开多仓条件 AND HOLDING<=0,10,MARKET,C);
EXIT 平空:SELLSHORT(平空仓条件 AND HOLDING<0,10,MARKET,C);
END
IF 不开空 THEN BEGIN
EXIT 开空:BUYSHORT(开空仓条件 AND HOLDING>=0,10,MARKET,C);
EXIT 平多:SELL(平多仓条件 AND HOLDING>0,10,MARKET,C);
END
平空:SELLSHORT(平空仓条件 AND HOLDING<0,10,MARKET,C);
平多:SELL(平多仓条件 AND HOLDING>0,10,MARKET,C);
开空:BUYSHORT(开空仓条件 AND HOLDING>=0,10,MARKET,C);
开多:BUY(开多仓条件 AND HOLDING<=0,10,MARKET,C);
改成
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容