如何编写上下通道买卖信号?
本帖最后由 hbxtxq77 于 2015-5-28 20:49 编辑自己写的空头代码,如何过滤掉多头趋势中的信号?
Params
Numeric B_Length1(13);// 长周期突破
Numeric B_Length2(3);
Numeric lots(1);// 头寸大小
Vars
NumericSeries HiBand1;
NumericSeries HiBand2;
NumericSeries LoBand1;
NumericSeries LoBand2;
NumericSeries MA3;
//以下多头
Begin
HiBand1 = highest(high,B_Length1);//长
LoBand1 = lowest(low,B_Length1);//长
HiBand2 = highest(high,B_Length2);//短
LoBand2 = lowest(low,B_Length2);//短
MA3 = ((High-Low)/2+LOW);
PlotNumeric("HiBand1",HiBand1);
PlotNumeric("LoBand1",LoBand1);
plotnumeric("HiBand2",HiBand2);
plotnumeric("LoBand2",LoBand2);
PlotNumeric("MA3",MA3);
if(HiBand1>hiband2)
{
SellShort(lots,0);
}
Else
if ( LoBand1<LoBand2)
{
BuyToCover(lots,0);
}
End 希望大家能把自己的想法注入到这个程序中。。。:lol
经过改造的上下通道突破。 回测报告
加上止损,效果更好。 加上止损的回测
页:
[1]