Board logo

标题: 【Detrended Price Osc】 [打印本页]

作者: 龙听    时间: 2022-11-3 11:19     标题: 【Detrended Price Osc】

  1. inputs:
  2.         Price( Close ),
  3.         Length( 14 ),
  4.         ColorNormLength( 14 ),                                                      
  5.                                                                                      
  6.         UpColor( Yellow ),                                                            
  7.                                      
  8.         DnColor( Magenta ),                                                            
  9.                                      
  10.         GridForegroundColor( Black ) ;                                                
  11.                                                                                      
  12.                                      
  13.                 
  14.                                                                                     
  15.                                                                                     
  16.                                                                                   
  17.                  

  18. variables:
  19.         var0( 0 ),
  20.         var1( 0 ),
  21.         var2( 0 ) ;

  22. if CurrentBar = 1 then
  23.         var0 = GetAppInfo( aiApplicationType ) ;

  24. var1 = Detrend( Price, Length ) ;

  25. Plot1( var1, "DPO" ) ;
  26. Plot2( 0, "ZeroLine" ) ;

  27. condition1 = UpColor >= 0 and DnColor >= 0 ;      
  28. if condition1 then
  29.         begin
  30.         var2 = NormGradientColor( var1, true, ColorNormLength, UpColor, DnColor ) ;
  31.         if var0 = 1 then                                
  32.                 SetPlotColor( 1, var2 )
  33.         else if var0 > 1 then                                 
  34.                 begin
  35.                 SetPlotColor( 1, GridForegroundColor ) ;
  36.                 SetPlotBGColor( 1, var2 ) ;
  37.                 end ;
  38.         end ;
复制代码





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2