美林证券交易大师的交易策略[开拓者公式]
- 源码仅供参考:
Params
Numeric Length1(23);
Numeric Length2(30);
Numeric Lots(1);
Numeric Offset(0);
Vars
Numeric EMA1;
Numeric EMA2;
NumericSeries Myhigh;
NumericSeries Mylow;
Begin
EMA1=XAverage(Close[1], Length1);
EMA2=XAverage(Close[1], Length2);
If(CurrentBar==0)
{
Myhigh=InvalidNumeric;
Mylow=InvalidNumeric;
}
Else
{
Myhigh=Myhigh[1];
Mylow=Mylow[1];
}
If(CurrentBar<Length2) Return;
PlotNumeric("EMA1",EMA1);
PlotNumeric("EMA2",EMA2);
If(Myhigh==InvalidNumeric && Close>EMA1 && Close>EMA2 && MarketPosition!=1)
{
Myhigh=High;
}
If(Myhigh!=InvalidNumeric && High>Myhigh)
{
Buy(Lots,Max(Open,Myhigh+Offset*MinMove*PriceScale));
Myhigh=InvalidNumeric;
}
If(Mylow==InvalidNumeric && Close<EMA1 && Close<EMA2 && MarketPosition!=-1)
{
Mylow=Low;
}
If(Mylow!=InvalidNumeric && Low<Mylow)
{
SellShort(Lots,Min(Open,Mylow-Offset*MinMove*PriceScale));
Mylow=InvalidNumeric;
}
Commentary("多头入场价:"+Text(Myhigh));
Commentary("空头入场价:"+Text(Mylow));
End
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 262069696 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容