- UID
- 2
- 积分
- 2892817
- 威望
- 1396440 布
- 龙e币
- 1496377 刀
- 在线时间
- 13326 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-12-26
|
【Volume Ratio】
- inputs:
- AvgLength( 14 ),
- UpVolAlertPct( 5 ),
- DnVolAlertPct( -5 ),
-
- ColorNormLength( 14 ),
-
- UpColor( Yellow ),
-
- DnColor( Cyan ) ;
- variables:
- var0( 0 ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ) ;
-
- if BarType <= 1 or BarType >= 5 then
- begin
- var0 = UpTicks + DownTicks ;
- if var0 > 0 then
- var1 = 100 * ( UpTicks - DownTicks ) / var0
- else
- var1 = 0 ;
- var2 = XAverage( var1, AvgLength ) ;
- Plot1( var2, "VolRatioAvg" ) ;
- Plot2( 0, "ZeroLine" ) ;
- condition1 = UpColor >= 0 and DnColor >= 0 ;
- if condition1 then
- begin
- var3 = NormGradientColor( var2, true, ColorNormLength, UpColor,
- DnColor ) ;
- SetPlotColor( 1, var3 ) ;
- end ;
-
- condition1 = var2 crosses over UpVolAlertPct ;
- if condition1 then
- Alert( "UpVol alert" )
- else
- begin
- condition1 = var2 crosses under DnVolAlertPct ;
- if condition1 then
- Alert( "DnVol alert" ) ;
- end;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|