Params
//此处添加参数
Vars
Numeric ma1;
Numeric ma2;
bool boollong;
bool boolshort;
bool condition1;
Bool condition2;
Begin
data0.ma1 =data0.Average(data0.close,5);
data0.ma2 =data0.Average(data0.close,20);
data0.PlotNumeric("data0.ma1",data0.ma1);
data0.PlotNumeric("data0.ma2",data0.ma2);
data1.PlotNumeric("data1.ma1",data0.ma1);
data1.PlotNumeric("data1.ma2",data0.ma2);
data0.boollong =data0.CrossOver(data0.ma1,data0.ma2);
data0.boolshort =data0.Crossunder(data0.ma1,data0.ma2);//大周期开仓条件
data1.condition1;// =
data1.condition2;// =小周期开仓条件
If(data0.boollong anddata1.condition1 anddata1.MarketPosition<>1)
{
data1.buy(1,data1.open);
}
if(data[0].boolshort anddata1.condition2 anddata1.MarketPosition<>-1)
{
data1.sell(1,data1.open);
}
End