- 精华
- 0
- 在线时间
- 67 小时
- UID
- 260950
- 积分
- 7
- 帖子
- 5
- 阅读权限
- 10
- 注册时间
- 2017-12-24
- 最后登录
- 2018-1-23
- 精华
- 0
- UID
- 260950
- 积分
- 7
- 帖子
- 5
- 主题
- 2
- 阅读权限
- 10
- 注册时间
- 2017-12-24
- 最后登录
- 2018-1-23
|
请小米版主帮看一看, 以下两个模型有没有偷价,和未来函数
模型1
// 简称: JYXT_Aberration
// 名称: Aberration
// 类别: 公式应用
// 类型: 用户应用
// 输出: Void
//------------------------------------------------------------------------
Params
Numeric Length(56);
Numeric StdDevUp(2.0); //到2011年十大策略第一名
Numeric StdDevDn(10); //长线 趋势 多品种
Numeric Lots(6);
Vars
NumericSeries UpperBand;
NumericSeries LowerBand;
NumericSeries AveMa;
Numeric StdValue;
Begin
AveMa=Average(Close[1],Length);
StdValue = StandardDev(Close[1],Length);
UpperBand=Avema+StdDevUp*StdValue;
LowerBand=Avema-StdDevUp*StdValue;
PlotNumeric("UpperBand",UpperBand);
PlotNumeric("LowerBand",LowerBand);
PlotNumeric("AveMa",AveMa);
If(MarketPosition!=1 &&CrossOver(Close[1],UpperBand[1]))
{
Buy(Lots,Open);
}
If(MarketPosition!=-1 &&CrossUnder(Close[1],LowerBand[1]))
{
SellShort(Lots,Open);
}
If(MarketPosition==1 && Close[1]<AveMa[1])
{
Sell(Lots,Open);
}
If(MarketPosition==-1 && Close[1]>AveMa[1])
{
BuyToCover(Lots,Open);
}
End
模型2
// 简称: BDZS_12
// 名称: 波动止损_12
// 类别: 公式应用
// 类型: 用户应用
// 输出: Void
//------------------------------------------------------------------------
Params
Numeric Lots(6);
Numeric nOffset(3);
Numeric HLength(5);
Numeric LLength(5);
Numeric AtrLength(0.05);
Numeric myBarsSinceEntry(9);
Vars
NumericSeries HHH;
NumericSeries LLL;
NumericSeries HHH1;
NumericSeries LLL1;
NumericSeries Atr;
Numeric myPrice;
NumericSeries StopLine;
NumericSeries LastPrice;
Numeric MinPoint;
Begin
MinPoint = MinMove*PriceScale;
HHH = Highest(High,HLength);
LLL = Lowest(Low,LLength);
HHH1 = Highest(High,10);
LLL1 = Lowest(Low,10);
Atr = AvgTrueRange(10);
If(MarketPosition==1)
{
//LLL1 = Max(LLL1,LastPrice);
LLL1 = Max(LLL1,LLL1[1]);
//PlotNumeric("LLL1",LLL1);
If(BarsSinceEntry>myBarsSinceEntry || High>LastPrice+Atr[1])
{
StopLine = Max(StopLine,LLL1[1] + (BarsSinceEntry)*Atr[1]*AtrLength);
}
PlotNumeric("多头止损:",StopLine);
If(Low<StopLine)
{
myPrice = Min(Open,StopLine) - MinPoint*nOffset;
Sell(Lots,myPrice);
}
}
If(MarketPosition==-1)
{
//HHH1 = Min(HHH1,LastPrice);
HHH1 = Min(HHH1,HHH1[1]);
//PlotNumeric("HHH1",HHH1);
If(BarsSinceEntry>myBarsSinceEntry || Low<LastPrice-Atr[1])
{
StopLine = Min(StopLine,HHH1[1] - (BarsSinceEntry)*Atr[1]*AtrLength);
}
PlotNumeric("空头止损:",StopLine);
If(High>StopLine)
{
myPrice = Max(Open,StopLine) + MinPoint*nOffset;
BuyToCover(Lots,myPrice);
}
}
If(MarketPosition<>1)
{
If(High>HHH[1])
{
myPrice = Max(Open,HHH[1]);
Buy(Lots,myPrice + MinPoint*nOffset);
LastPrice = myPrice;
StopLine = myPrice - Atr[1]*1.5;
Return;
}
}
If(MarketPosition<>-1)
{
If(Low<LLL[1])
{
myPrice = Min(Open,LLL[1]);
SellShort(Lots,myPrice - MinPoint*nOffset);
LastPrice = myPrice;
StopLine = myPrice + Atr[1]*1.5;
Return;
}
}
If(time == 0.1510)
{
Sell(Lots,Open - MinPoint*nOffset);
BuyToCover(Lots,Open + MinPoint*nOffset);
}
End
谢谢 |
|