3楼 
波动率VE=最近的30天的(日高点-日低点)的平均值。
把这个波动率VE×1.5倍,
算出的数值,加上当天的收盘价,在下一天的k线上方标一个点;
            当天的收盘价减去这个值,在第下一天的k线下方标一个点。
最好参数可调整,就是30和1.5,可调整。
不知这样说是否算清楚了
韬客社区www.talkfx.co
发表于:2008-08-06 14:35只看该作者
4楼 
#property indicator_chart_window
#property  indicator_buffers 3
#property  indicator_color1  Red
#property  indicator_color2  Yellow
extern int    r=30;
extern double k=1.7;
double     ABuffer;
double     BBuffer;
double     HL;
int init()  {
   SetIndexBuffer(0,ABuffer);
   SetIndexBuffer(1,BBuffer);
   SetIndexBuffer(2,HL);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   IndicatorDigits(6);
   return(0);
}
int start()  {
   int limit,t;
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   for(t=0; t
5楼 
谢谢哥们,
不过感觉上有点怪,请问那个点,是放在计算当天,还是下一天,我要下一天,,,
韬客社区www.talkfx.co
发表于:2008-08-07 05:40只看该作者
7楼 
把这两句
      ABuffer[t]=Close[t]+iMAOnArray(HL,Bars,r,0,MODE_SMA,t)*k;
      BBuffer[t]=Close[t]-iMAOnArray(HL,Bars,r,0,MODE_SMA,t)*k;
改为:
      ABuffer[t]=Close[t+1]+iMAOnArray(HL,Bars,r,0,MODE_SMA,t+1)*k;
      BBuffer[t]=Close[t+1]-iMAOnArray(HL,Bars,r,0,MODE_SMA,t+1)*k;
8楼 
谢谢,就是这样:D
韬客社区www.talkfx.co




















