等级: 新手上路
- 注册:
- 2024-10-21
- 曾用名:
|
楼主 |
发表于 2024-11-13 11:35
|
显示全部楼层
// 定义变量
LC:=REF(CLOSE,1); //取前一根K线的收盘价
VID:=SUM(VOL,2)/((HHV(HIGH,2)-LLV(LOW,2))*100); //2周期成交量相加,除以2周期最高价和最低价的差值乘以100
RC:=(CLOSE-LC)*VID;//收盘价与LC的差值,乘以VID
LONG:=SUM(RC,0); //将所有K线上RC的数值求和
LONGMA1:=SMA(LONG,10,1); //LONG的10个周期内的扩展指数加权移动平均
LONGMA2:=SMA(LONG,20,1); //LONG的20个周期内的扩展指数加权移动平均
LON:LONGMA1-LONGMA2; //LONGMA1与LONGMA2做差
LONGMA:MA(LON,2); //LON的N个周期均值
LONGT:LON,COLORSTICK;
PB1:(EMA(CLOSE,4)+MA(CLOSE,4*2)+MA(CLOSE,4*4))/3;
PB2:(EMA(CLOSE,6)+MA(CLOSE,6*2)+MA(CLOSE,6*4))/3;
PB3:(EMA(CLOSE,9)+MA(CLOSE,9*2)+MA(CLOSE,9*4))/3;
PB4:(EMA(CLOSE,13)+MA(CLOSE,13*2)+MA(CLOSE,13*4))/3;
PB5:(EMA(CLOSE,18)+MA(CLOSE,18*2)+MA(CLOSE,18*4))/3;
PB6:(EMA(CLOSE,24)+MA(CLOSE,24*2)+MA(CLOSE,24*4))/3; //定义6条瀑布线
PARTLINE(PB1>REF(PB6,1),PB6,COLORRED,2);
PARTLINE(PB1<REF(PB6,1),PB6,colorgreen,2);
if PB1>ref(PB6,1) and cross(LONGT,0) then
begin
sellshort(1,holding,marketr);
buy(holding=0,10,marketr);
end
if PB1<ref(PB6,1) and cross(0,LONGT) then
begin
sell(1,holding,marketr);
buyshort(holding=0,10,marketr);
end
老师好,有的地方没有信号是哪里出了问题,请老师指点一下,谢谢 |
|