Params
Numeric length(10);
// 交易手数
Numeric lots(6);
Vars
Numeric ma;
Begin
// 开盘价均线
ma = Average(Open, length);
// 最高价大于均价,并且当前持仓建仓次数小于1,日内两点50以后禁止开单
If (High > ma And CurrentEntries() < 1 And Time < 0.1420)
{
Buy(lots, IntPart(ma) + 1);
}
// 最低价小于均价,并且不允许在建仓k线平仓
If (Low < ma And BarsSinceLastEntry() > 0)
{
Sell(lots, IntPart(ma) - 1);
}
// 两点57分自动平仓,或者在禁止开单后出现两根阳线,以开盘价平仓
If (Time > 0.1430 Or (Time > 0.1420 And Close[1] > Open[1] And Close[2] > Open[2]))
{
Sell(lots, Open);
}
PlotNumeric("ma", ma);
End
自动寻找有利平仓点
最新推荐文章于 2019-06-11 14:16:29 发布