当前位置:分析家公式网 → 股票公式 → 开拓者公式 → 一键转帖:开拓者TB的RangeBreak交易模型源码
软件名称:[B]开拓者TB的RangeBreak交易模型源码[/B]
软件类型:国产软件
运行环境:Win2000/WinXP/Win2003/WinVista
软件语言:简体中文
授权方式:共享软件
软件大小:0 Bytes
官方主页:Home Page
更新时间:2013-03-03 07:23:04
软件简介:
- 咨询内容: 本帖最后由 rookies 于 2012-7-20 21:23 编辑
日内效果不如隔日来得好
Params
Numeric PercentOfRange(0.5); //突破系数
Numeric ExitOnCloseMins(14.55); //最后交易时间
Numeric MinRange(0.002); //开盘价的百分比
Numeric Lots(1); //开仓量
Vars
Numeric MyExitPrice;
Numeric DayOpen;
Numeric preDayRange;
Numeric UpperBand; //上轨
Numeric LowerBand; //下轨
Numeric MyPrice;
Begin
DayOpen = OpenD(0);
preDayRange = HighD(1)-LowD(1); //昨日波幅
PreDayRange = Max(PreDayRange,DayOpen*MinRange);
UpperBand = DayOpen+PreDayRange*PercentOfRange; //求出上轨
LowerBand = DayOpen-PreDayRange*PercentOfRange; //求出下轨
PlotNumeric("UpperBand",UpperBand);
PlotNumeric("LowerBand",LowerBand);
If(MarketPosition!=1 && High>=UpperBand && Time<ExitOnCloseMins/100) //开多条件 价咯高于上轨,时间小于0.145500
{
MyPrice = Max(UpperBand,Open);
Buy(Lots,MyPrice);
Return;
}
If(MarketPosition!=-1 && Low<=LowerBand &&Time<ExitOnCloseMins/100)
{
MyPrice = Min(LowerBand,Open);
SellShort(Lots,MyPrice);
Return;
}
If( MarketPosition==1 && Low<LowerBand) //多头中如果下破下轨止损
{
MyExitPrice=Min(Open,LowerBand);
Sell(Lots,MyExitPrice);
Return;
}
If( MarketPosition==-1 && High>UpperBand) //空头中如果上穿上轨止损
{
MyExitPrice=Max(Open,UpperBand);
BuytoCover(Lots,MyExitPrice);
Return;
}
End
- TB技术人员: 本帖最后由 rookies 于 2012-7-21 11:25 编辑
隔日情况下,允许二次开仓,可以提高盈利率
Params
Numeric PercentOfRange(0.5);
Numeric ExitOnCloseMins(14.50);
Numeric MinRange(0.002);
Numeric Lots(1);
Numeric StopPointUpper(1);
Numeric StopPointLower(1);
Numeric Length(12);
Numeric TakeStart(0.1);
Numeric TakeStop(0.5);
Vars
Numeric LastTradeMins(14.00);
NumericSeries Ma;
Numeric MyExitPrice;
Numeric DayOpen;
Numeric preDayRange;
Numeric UpperBand;
Numeric LowerBand;
Numeric MyPrice;
Numeric StopLine;
BoolSeries UpperStoped;
BoolSeries LowerStoped;
NumericSeries HigherAfterEntry;
NumericSeries LowerAfterEntry;
String BoolSet;
Begin
Ma=Average(Close,Length);
DayOpen = OpenD(0);
preDayRange = HighD(1)-LowD(1);
PreDayRange = Max(PreDayRange,DayOpen*MinRange);
Commentary("DayOpen="+Text(DayOpen));
Commentary("preDayRange="+Text(preDayRange));
UpperBand = DayOpen+PreDayRange*PercentOfRange;
LowerBand = DayOpen-PreDayRange*PercentOfRange;
Commentary("UpperBand="+Text(DayOpen+PreDayRange*PercentOfRange));
Commentary("UpperBand="+Text(DayOpen-PreDayRange*PercentOfRange));
PlotNumeric("UpperBand",UpperBand);
PlotNumeric("LowerBand",LowerBand);
If(Date!=Date[1])
&
[url=http://www.70822.com/soft/sort013/sort083/down-59428.html]开拓者TB的RangeBreak交易模型源码[/url]