log time scale.afl

来自「一个更精度的平滑涵数, 可用于股票交易系统.用于Amibroker 平台」· AFL 代码 · 共 51 行

AFL
51
字号
//------------------------------------------------------------------------------
//
//  Formula Name:    Log Time Scale
//  Author/Uploader: Jeff Parent 
//  E-mail:          
//  Date/Time Added: 2004-04-23 10:03:05
//  Origin:          
//  Keywords:        
//  Level:           medium
//  Flags:           function
//  Formula URL:     http://www.amibroker.com/library/formula.php?id=354
//  Details URL:     http://www.amibroker.com/library/detail.php?id=354
//
//------------------------------------------------------------------------------
//
//  Uses Param feature to adjust increaasing time compression as chart moves
//  back in time. A bit like looking at multiple time frame charts, except its
//  all in one chart.
//
//------------------------------------------------------------------------------

//Log Time

s=Param("speed",0,0,0.04,0.0001);
b=BarCount-1;
bc=b;
Hy=Null;Ly=Null;Oy=Null;Cy=Null;

do
{
Hx=0;Lx=1000000;
Cy[bc]=C[b];
f=int(exp(s*(BarCount-bc+1)));
b1=b-f;

while (b>b1 AND b>-1)
{
if (H[b]>Hx) Hx=H[b];
if (L[b]<Lx) Lx=L[b];
b--;
}
Hy[bc]=Hx;Ly[bc]=Lx;Oy[bc]=O[b+1];
bc--;

} while (b>-1);

PlotOHLC(Oy,Hy,Ly,Cy,"",1,styleCandle);
Plot(Oy,"open",1,styleNoDraw);
Plot(Hy,"hi",1,styleNoDraw);
Plot(Ly,"lo",1,styleNoDraw);
Plot(Cy,"close",1,styleNoDraw);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?