TB交易开拓者实盘策略002

该博客详细介绍了TB交易开拓者平台中的一种实盘策略,包括策略参数设置、开仓条件计算、过滤条件判断以及开收盘处理和常规交易操作。通过对高低点与黄线通道的比较,确定交易信号,并设置了止损和止盈点。

Params

Numeric midtanqilen(5); //黄线通道突破的长度参数初始值
Numeric BreakLimen(0); //价格突破黄线超出的比例
Numeric barsPer(0); //价格突破黄线的个数
Numeric WinPoint(1000); //盈利点数
Numeric LossPoint(1000);
Numeric Begintime(9.42); //
Numeric endtime(0.1506);
Numeric lastovertime(0.1512);
Numeric lastmins(0.1514);
Numeric lots(1);

Vars

//************开仓和过滤条件的一些变量************
Bool buyfliter4(False);			//买入过滤条件  针对策略db4
Bool sellfliter4(False);		//卖出过滤条件
Bool buycon4(False);			//买入条件 
Bool sellcon4(False);			//卖出条件
//*************布林通道计算的一些变量*******************
NumericSeries MidLine;			//日内黄线
Numeric todaybarnums(0);		//今天BARS数目
//***********黄线突破交易的一些变量************
Numeric midlen;					//通道的长度	
Numeric i;
Numeric Countbars;
Numeric LongCountBars;
Numeric ShortCountBars; 
NumericSeries LongLossTick;
NumericSeries ShortLossTick;
NumericSeries midlinePer;

Begin

//<

TB开拓者策略代码在不同示例中有不同体现: - 策略002的代码如下: ```python //***第五步:常规交易部分 //简单交易 Commentary(“ShortLossTick=”+Text(ShortLossTick)); If(MarketPosition==0 And buycon4 And buyfliter4 And longCountbars>=barsPer And abs(high[1]-midlinePer)/midline[1]>BreakLimen And longLossTick<2) { If(MarketPosition==-1)ShortLossTick=ShortLossTick+1; Buy(lots,Open); } If(MarketPosition==0 And sellcon4 And sellfliter4 And shortCountbars>=barsPer And abs(low[1]-midlinePer)/midline[1]>BreakLimen And ShortLossTick<2) { If(MarketPosition==1)longLossTick=longLossTick+1; SellShort(lots,Open); } if(MarketPosition==1) { if(high>=EntryPrice+WinPoint)Sell(0,EntryPrice+WinPoint); if(low<=EntryPrice-lossPoint) { Sell(0,EntryPrice-lossPoint); longLossTick=longLossTick+1; } } if(MarketPosition==-1) { if(low<=EntryPrice-WinPoint)BuyToCover(0,EntryPrice-WinPoint); if(high>=EntryPrice+lossPoint) { BuyToCover(0,EntryPrice+lossPoint); shortLossTick=shortLossTick+1; } } End ``` - 策略003的代码如下: ```python PlotNumeric(“SlopeA”,SlopeA,0,Red); PlotNumeric(“SlopeB”,SlopeB,0,Green); Commentary(“TotalEquity=”+Text(Open*BigPointValue()*ContractUnit()*margin)); Commentary(“PDI=”+Text(ADX(1,14))); Commentary(“MDI=”+text(ADX(2,14))); Commentary(“ADX=”+Text(ADX(3,14))); End ``` - 策略001的代码如下: ```python if(MarketPosition==0 And mt[1]>RangeLimen And mta[1]>0 ) { Buy(lots,Open); } if(MarketPosition==0 And mt[1]>RangeLimen And mta[1]<0 ) { SellShort(lots,Open); } /* if(MarketPosition!=0 And mt[1]<0) { Sell(0,Open); BuyToCover(0,Open); }*/ if(MarketPosition==1 And mt[1]<0) Sell(0,Open); if(MarketPosition==-1 And mt[1]<0) BuyToCover(0,Open); ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值