- 精华
- 0
- 在线时间
- 108 小时
- UID
- 250562
- 积分
- 105
- 帖子
- 76
- 阅读权限
- 30
- 注册时间
- 2017-4-26
- 最后登录
- 2021-10-15
- 精华
- 0
- UID
- 250562
- 积分
- 105
- 帖子
- 76
- 主题
- 27
- 阅读权限
- 30
- 注册时间
- 2017-4-26
- 最后登录
- 2021-10-15
|
Params
// 基本参数:
//Numeric Fund(30000);
Vars
// 基本变量:
// Numeric Slip;
Numeric PosSizeL(1);
Numeric PosSizeS(1);
Numeric Direction(0);
// Numeric SlipSetting(1);
Numeric Lots( 0 );
// 进出场价格变量:
//Numeric MyEntryPrice;
//Numeric MyExitPrice;
// Numeric MyEntryPrice1;
NumericSeries AH;
NumericSeries AL;
// 多头进场变量:
BoolSeries EntMarketCondL;
BoolSeries EntMarketCondS;
NumericSeries EntStopL;
// 空头进场变量:
NumericSeries EntStopS;
// 多头离场变量:
NumericSeries TrailStopL;
NumericSeries TrailStartL;
NumericSeries TrailStopRangeL;
NumericSeries TrailStartRangeL;
// 空头离场变量:
NumericSeries TrailStopS;
NumericSeries NN ;
NumericSeries OO; //今日开盘价
NumericSeries CC1;//昨日收盘价
NumericSeries OO1;//昨日开盘价
NumericSeries hh;//昨日最高价
NumericSeries ll;
NumericSeries H40;
NumericSeries L40;
NumericSeries bkh;
NumericSeries skl;
Numeric MinPoint; // 一个最小变动单位,也就是一跳
NumericSeries HighestAfterEntry; // 开仓后出现的最高价
NumericSeries LowestAfterEntry; // 开仓后出现的最低价
Begin
If(!CallAuctionFilter()) Return;
Lots=1;//Max(1,intpart(Fund/(O*ContractUnit*BigPointValue*0.1))); //1;//
// 滑点计算:
// Slip = SlipSetting * MinMove * PriceScale;
// NN = BarsSinceToday+1;
// OO = OpenD(0); //今日开盘价
CC1 = Closed(1);//昨日收盘价
// OO1 = opend(1);//昨日开盘价
// hh = highd(1);//昨日最高价
// ll = lowd(1);
// H40 = Highest(Close,170);
// L40 = Lowest(Close,170);
// bkh= Highest(h,BarsSinceEntry);
// skl=lowest(l,BarsSinceEntry);
//MyEntryPrice1=AvgEntryPrice;
//PlotNumeric("ah[2]",ah[2],0,Blue);
//PlotNumeric("upBand",upBand,0,Yellow);
//PlotNumeric("al[2]",al[2],0,White);
{ // 多头市价(Market)进场:
EntMarketCondL = CrossOver(o[1], cc1*1.01);//
If ( Direction >= 0 ) {
If ( MarketPosition <> 1 &&EntMarketCondL &&time==(1458/10000)) //
{
//MyEntryPrice = IIF(AccountDataExist, 0, Open);
BuyToCover(0,o);
Buy(Lots, o);
}
}
// 空头突破(Stop)进场:
EntMarketCondS = CrossOver(cc1*0.99,o[1]);//
If ( Direction <= 0 ) {
If ( MarketPosition <> -1&&EntMarketCondS &&time==(1458/10000)) //
{
//MyEntryPrice = IIF(AccountDataExist, 0, Open);
Sell(0,o);
SellShort(Lots, o);
}
}
}
End
1分钟线回测,请教版主,这个策略看不到开仓信号是为什么呢
|
|