欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 有人修改成金字塔吗

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有5216人关注过本帖树形打印复制链接

主题:有人修改成金字塔吗

帅哥哟,离线,有人找我吗?
期指新手
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:133 积分:981 威望:0 精华:0 注册:2010/6/1 17:02:14
有人修改成金字塔吗  发帖心情 Post By:2010/8/17 18:24:10    Post IP:114.82.160.86[只看该作者]

 Numeric ceilingAmt(60);
    Numeric floorAmt(20);
    Numeric bolBandTrig(2.00);
Vars
    Numeric lookBackDays(20);         
    Numeric todayVolatility(0);
    Numeric yesterDayVolatility(0);
    Numeric deltaVolatility(0);
    NumericSeries buyPoint(0);
    NumericSeries sellPoint(0);
    NumericSeries longLiqPoint(0);
    NumericSeries shortLiqPoint(0);
    Numeric upBand(0);
    Numeric dnBand(0);
    Numeric MidLine(0);
    Numeric Band(0);
Begin
    todayVolatility = StandardDev(Close,30,1);
    yesterDayVolatility = StandardDev(Close[1],30,1);
    deltaVolatility = (todayVolatility - yesterDayVolatility)/todayVolatility;
    lookBackDays = lookBackDays * (1 + deltaVolatility);
    lookBackDays = Round(lookBackDays,0);
    lookBackDays = Min(lookBackDays,ceilingAmt);
    lookBackDays = Max(lookBackDays,floorAmt);
    MidLine = AverageFC(Close,lookBackDays);
    Band = StandardDev(Close,lookBackDays,bolBandTrig);
    upBand = MidLine + bolBandTrig * Band;
    dnBand = MidLine - bolBandTrig * Band;
    buyPoint = Highest(High[1],lookBackDays);
    sellPoint = Lowest(Low[1],lookBackDays);
    longLiqPoint = Average(Close[1],lookBackDays);
    shortLiqPoint = Average(Close[1],lookBackDays);

if(Close > upBand)  
{
   If(CrossOver(high,buyPoint))   
  {
     Buy(1,max( buyPoint, Low ));

  }
Commentary("多头触发价:"+Text(buyPoint));

}

if(Close < dnBand)
{

   If(CrossUnder(Low,sellPoint ))
   {
      SellShort(1,min( sellPoint , High ));
   }
Commentary("空头触发价:"+Text(sellPoint));

}
if(MarketPosition == 1)
{  
   If(CrossUnder(Low,longLiqPoint ))
   {
      Sell(1,min( longLiqPoint , High ));
   }
Commentary("多头退出:"+Text(longLiqPoint));
}




if(MarketPosition == -1)

{
   If(CrossOver(high,shortLiqPoint))   
  {
     BuyToCover(1,max( shortLiqPoint, Low ));
  }
Commentary("多头退出:"+Text(shortLiqPoint));

}


End

 回到顶部