等级: 免费版
- 注册:
- 2021-9-12
- 曾用名:
|
本帖最后由 技术006 于 2021-10-22 14:35 编辑
在吗老师
补充内容 (2021-10-22 14:00):
开多:=,计算前2根K线是阴线, (收盘价和下引线K线一根比一根低),在计算前根K线的 (收盘k线和下引线小于开盘K线2跳),是阳线,开多,.............平多:=,计算前2根K线是阳线, (收盘价和上引线K线一根比一根高),在计算前根K线 (收盘k线和上引线大于开盘K线2跳),是阴线,平多,...........开空:=计算前2根K线 ,是阳线,(收盘价和上引线K线一根比一根高),在计算前根K线 (收盘k线和上引线大于开盘K线2跳),是阴线,开空,,,,,,,,,,,,,平空:=,计算前2根K线 是阴线,(收盘价和下引线K线一根比一根低),在计算前根K线 (收盘k线和下引线小于开盘K线2跳),是阳线,平空
补充内容 (2021-10-22 14:09):
[PEL] 复制代码 ////计算前2根K线收盘价和下引线K线一根比一根低,在计算前根K线的收盘k线和下引线小于开盘K线2跳开多
cond1:REF(close,2)>REF(close,1) and REF(low,2)>REF(low,1) and (close-REF(close,1))>2 and (low-REF(low,1))>2;
cond2:REF(close,2)<REF(close,1) and REF(low,2)<REF(low,1) and (close-REF(close,1))<2 and (low-REF(low,1))<2;
//if cond1=1 then BEGIN
// TSELLSHORT();
// TBUY();
//END
input:多止损跳数(5,1,100,1),多移动止损跳(2,1,100,1),盈利浮度多(20,1,100,1);
input:空止损跳数(5,1,100,1),空移动止损跳(2,1,100,1),盈利浮度空(20,1,100,1);
input:多止盈跳数(5,1,100,1),多止盈跳数(5,1,100,1),手数(1,1,100,1);
//ma5:ma(c,1);
//ma10:ma(c,2);
//ma20:ma(c,3);
////ma30:ma(c,4);
//dtpl:ma5>ma10 and ma10>ma20;// and ma20>ma30;
//ktpl:ma5<ma10 and ma10<ma20;// and ma20<ma30;
// 开多:tbuy(dtpl,手数,mkt);
// 开空:tbuyshort(ktpl,手数,mkt);
//开多
//if dtpl and low then // tbuyholding(1)=0 and
if cond1=1 and low then
BEGIN
// begin
开多:tbuy(tbuyholding(1)>=0,手数,lmt,o);//,(kdpkj+开加跳*mindiff));// mkt);//
// 开多:tbuy(1,手数,mkt);
end
//平多
//if ktpl and HIGH then
if cond2=1 and HIGH then
BEGIN
// begin
平多:tsell(tbuyholding(1)>0 ,tbuyholding(1),lmt,o); //(kkpdj-平减跳*mindiff)); // mkt);//
end
//开空
//if ktpl and HIGH then // tsellholding(1)=0 and
if cond2=1 and HIGH then
BEGIN
// begin
开空:tbuyshort(tsellholding(1)>=0,手数,lmt,o);//,( high-开减跳*mindiff));//mkt);//
// 开空:tbuyshort(1,手数,mkt);
end
//平空
//if dtpl and low then
if cond1=1 and low then
BEGIN
// begin
平空:tsellshort(tsellholding(1)>0,tsellholding(1),lmt,o);//(low+平加跳*mindiff)//mkt);//
end
//多移动止损
//input:多移动止损跳(5,1,100,1);
hh:=hhv(h,tenterbars+1);
xx:=hh-多移动止损跳*mindiff;
if TOPENPROFIT>=盈利浮度多*mindiff and c<=xx and tbuyholding(1)>0 then tsell(1,tbuyholding(1),lmt,o);//mkt);
//空移动止损
//input:空移动止损跳(5,1,100,1);
ll:=llv(l,tenterbars+1);
xx:=ll+空移动止损跳*mindiff;
if TOPENPROFIT>=盈利浮度空*mindiff and c>=xx and tsellholding(1)>0 then tsellshort(1,tsellholding(1),lmt,o);//mkt);
//多固定止损
//input:多止损跳数(2,1,100,1);
//input:多止盈跳数(5,1,100,1);
if c<tavgenterprice-多止损跳数*mindiff and tbuyholding(1)>0 then tsell(1,0,lmt,o);//mkt);
//if c>tavgenterprice+多止盈跳数*mindiff and tbuyholding(1)>0 then tsell(1,0,mkt);
//固定止损空
//input:空止损跳数(2,1,100,1);
//input:空止盈跳数(5,1,100,1);
if c>tavgenterprice+空止损跳数*mindiff and tsellholding(1)>0 then tsellshort(1,tsellholding(1),lmt,o);//,mkt);
//固定止盈空
//if c<tavgenterprice-空止盈跳数*mindiff and tsellholding(1)>0 then tsellshort(1,tsellholding(1),mkt);
//收盘平仓多
t3:=time>=closetime(1) and time<OPENTIME(2) or (time>=closetime(4));
if t3=1 and tbuyholding(1)>0 then 清多:tsell(1,tbuyholding(1),mkt);
//收盘平仓空
t3:=time>=closetime(1) and time<opentime(2) or (time>=closetime(0));
if t3=1 and tsellholding(1)>0 then 清空:tsellshort(1,tsellholding(1),mkt);
补充内容 (2021-10-22 14:10):
老师你帮我检查一下,帮我修改一下,看对吗
补充内容 (2021-10-22 14:12):
|
|