等级: 专业版
- 注册:
- 2023-4-6
- 曾用名:
|
楼主 |
发表于 2024-10-29 17:05
|
显示全部楼层
在图表里开多单的条件不是一个具体的价格,要将开多单时的条件转换为价格怎么实现,或者说在空单里是要求开多单的位置下跌多少时开空,这种怎么去实现呢?
或者说将开多单时保存一个虚拟的价格,代码怎么实现?
A:=EMA(LOW,36);
B:=EMA(HIGH,30);
F:=85;
K:=95;
D:=(EMA(((CLOSE-A)/(B-A))*(4),4))*(25);
G:=D,COLORRED,LINETHICK2;
G1:=D<REF(D,5);
I:=(((D-LLV(D,21))/(HHV(D,21)-LLV(D,21)))*(4))*(25);
M:=IF(CROSS(H,20) AND (G<40),70,0);
Z:=8;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:=L1+P1*7/8,COLORGREEN;
支撑:=L1+P1*0.5/8,COLORRED;
中线1:=(支撑+阻力)/2;
V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);
趋势线:=EMA(V11,3),LINETHICK2,COLORLIMAGENTA;
V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;
准备买入:=STICKLINE(趋势线<11,趋势线,11,5,0);
AA:=(趋势线<11) AND FILTER((趋势线<=11),15) AND C<中线1;
BB0:=REF(趋势线,1)<11 AND CROSS(趋势线,11) AND C<中线1;
BB1:=REF(趋势线,1)<11 AND REF(趋势线,1)>6 AND CROSS(趋势线,11);
BB2:=REF(趋势线,1)<6 AND REF(趋势线,1)>3 AND CROSS(趋势线,6);
BB3:=REF(趋势线,1)<3 AND REF(趋势线,1)>1 AND CROSS(趋势线,3);
BB4:=REF(趋势线,1)<1 AND REF(趋势线,1)>0 AND CROSS(趋势线,1);
BB5:=REF(趋势线,1)<0 AND CROSS(趋势线,0);
BB:=BB1=1 OR BB2=1 OR BB3=1 OR BB4=1 OR BB5=1;
XD:=BB=1 AND C<中线1;
SJ:=REF(BARSLAST(XD),1)+1;
SJ1:=SJ>=1 AND SJ<=10;
A1:=C<MA(C,5);
B2:=A1 AND SJ1;
B1:=REF(BARSLAST(B2),1)+1;
B3:=B1>=1 AND B1<=20;
XC:=C>MA(C,5) AND REF(C,1)<MA(C,5) AND COUNT((C>MA(C,5) AND REF(C,1)<MA(C,5)),B3)=1 AND B3;
D1:=(C-REF(C,1))/REF(C,1)*100;
D2:=SUM(D1,10)<=0.3;
XC1:=XC AND D2;
XC2:=SUM(XC1,B1)=2;
XC5:BARSLAST(XC2)=1; |
|