首页 > > 详细

突破昨天最高价最低价今天开盘价运算出的上下轨日内交易策略、TB程序化公式帮做

突破昨天最高价最低价今天开盘价运算出的上下轨日内交易策略
源码:
Params
Numeric PercentOfRange(0.8);
//突破参数N
Numeric ExitOnCloseMins(14.55);
//平仓时间
Numeric MinRange(0.2);
//最小Range
Numeric LastTradeMins(14.00);
//最后交易时间
Numeric BeginTradeMins(9.00);
Numeric Lots(1);
Numeric Stoplossset(1);
Vars
NumericSeries DayOpen;
NumericSeries preDayRange;
NumericSeries HigherAfterEntry;
NumericSeries LowerAfterEntry;
Numeric preDayHigh;
Numeric preDayLow;
Numeric UpperBand;
Numeric LowerBand;
Numeric MyPrice;
Numeric StopLine;
Begin
DayOpen=OpenD(0);
preDayHigh=HighD(1);
preDayLow=LowD(1);
preDayRange=HighD(1)-LowD(1);
UpperBand=DayOpen+preDayRange*PercentOfRange;
LowerBand=Dayopen-preDayRange*PercentOfRange;
If(BarsSinceEntry==1)
{
HigherAfterEntry=AvgEntryPrice;
LowerAfterEntry=HigherAfterEntry;
}Else If(BarsSinceEntry>1)
{
HigherAfterEntry=max (HigherAfterEntry[1],High[1]);
LowerAfterEntry=min(LowerAfterEntry[1],Low[1]);
}//
If(Date!=Date[1])
{DayOpen=Open;
preDayRange=preDayHigh-preDayLow;
If(preDayRange=UpperBandTimeMyprice)Myprice=Open;
Buy(1,Myprice);
Return;
}
If(MarketPosition!=1Low=ExitOnCloseMins/100)
{
Sell(1,Open);
BuyToCover(1,Open);
}
SetExitOncLOSE;
End
 

联系我们 - QQ: 88652583
© 2014 www.93stock.com
代写选股公式网!
声明:警惕假冒分子冒充本站提供证券咨询服务,选股公式网为非证券咨询机构,本站不提供有关股评、投资分析报告、股市预测,证券咨询等服务。本站仅提供股票、期货、黄金、外汇的软件技术交流与分享。本站文章为互联网文章,其仅供参考,并不构成投资建议。