|
Params
Numeric FastLength(6); //短周期
Numeric SlowLength(24); //长周期
Numeric fVol(1); //下单手数
Vars
NumericSeries AvgValue1;
NumericSeries AvgValue2;
Begin
AvgValue1 = EMA(CLOSE,FastLength);
AvgValue2 = EMA(CLOSE,SlowLength);
PlotNumeric("MA1",AvgValue1);
PlotNumeric("MA2",AvgValue2);
//均线交叉时开仓
if(AvgValue1 > AvgValue2)
{
If(A_SellPosition > 0){
BuyToCover(0,0);
}
if(A_BuyPosition == 0)
{
Buy(fVol,0);
PlotText(Q_AskPrice+MinMove* PriceScale,"上穿");
}
}
if(AvgValue1 < AvgValue2)
{
If(A_BuyPosition > 0){
Sell(0,0);
}
if(A_SellPosition == 0 )
{
SellShort(fVol,0);
PlotText(Q_BidPrice-MinMove* PriceScale,"下穿");
}
}
End
请老师帮我加上
确定开平仓信号后的第一根k线再开平仓
|
|