策略开仓问题
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",ah,0,Blue);
//PlotNumeric("upBand",upBand,0,Yellow);
//PlotNumeric("al",al,0,White);
{ // 多头市价(Market)进场:
EntMarketCondL = CrossOver(o, 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);//
If ( Direction <= 0 ) {
If ( MarketPosition <> -1&&EntMarketCondS &&time==(1458/10000)) //
{
//MyEntryPrice = IIF(AccountDataExist, 0, Open);
Sell(0,o);
SellShort(Lots, o);
}
}
}
End
1分钟线回测,请教版主,这个策略看不到开仓信号是为什么呢
C:\资管业务\资管软件\资管软件\TB程序化交易软件\TB商品设置.png 还有就是设置了商品设置里设置了起始回测日期,图表还是没有增加数据量
页:
[1]