序列变量在TB中的应用.ppt

序列变量在TB中的应用

* 求日内高低点 3 * 日内突破系统 P-1 Params Numeric nMins(30); Numeric nOffset(3); Vars NumericSeries HighestOfMins; NumericSeries lowestOfMins; Numeric myPrice; Numeric MinPoint; Numeric lots(1); 可设置的突破分钟数 突破价格偏移点 求日内高低点 3 * 日内突破系统 P-2 Begin MinPoint = MinMove*PriceScale; If(Date != Date[1]) { HighestOfMins = High; lowestOfMins = Low; }Else If(Time 0.0900+nMins*0.0001) { HighestOfMins = max(high,HighestOfMins[1]); lowestOfMins = min(Low,lowestOfMins[1]); }Else { HighestOfMins = HighestOfMins[1]; lowestOfMins = lowestOfMins[1]; } 求日内高低点 3 * 日内突破系统 P-3 If(High = HighestOfMins + nOffset*MinPoint MarketPosition != 1) { myPrice = HighestOfMins + nOffset*MinPoint; If(Open myPrice) myPrice = Open; Buy(lots,myPrice); } If(Low = lowestOfMins - nOffset*MinPoint MarketPosition != -1) { myPrice = lowestOfMins - nOffset*MinPoint; If(Open myPrice) myPrice = Open; SellShort(lots,myPrice); } If(Time = 0.1459) { Sell(lots,Open); BuyToCover(lots,Open); } End 求日内高低点 3 * 求日内高低点 3 * 求日内高低点 3 * 在记录传递一个序列值的同时,与当前行情价格进行比较,并按条件要求判断是沿用原数据值还是使用新数据值将序列变量值传递下去 * 具体实例讲述序列变量 求日内均线(数值型) 4 * 分时图上均线价 均价线是以成交价格与成交数量计算得来的加权平均数 均价线的计算公式 均价线 = 日内总成交金额/日内总成交手数 求日内均线 4 * 均价线 Vars NumericSeries baramount; NumericSeries barvol; numericseries dayavg; Begin if(date!=Date[1]) { baramount=close*Vol; barvol=vol; }else { baramount = baramount[1]+close*vol; barvol = barvol[1]+vol; } 序列变量声明 给变量赋值 求日内均线 4 * 均价线 dayavg = baramoun

文档评论(0)

1亿VIP精品文档

相关文档