Board logo

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

作者: 龙听    时间: 2022-11-3 13:08     标题: 【Price Channel】

  1. inputs:  Length( 20 ), Displace( 0 ) ;
  2. variables:  var0( 0 ), var1( 0 ) ;

  3. var0 = Lowest( Low, Length )[1] ;
  4. var1 = Highest( High, Length )[1] ;

  5. condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
  6. if condition1 then
  7.         begin
  8.         Plot1[Displace]( var1, "UpperBand" ) ;
  9.         Plot2[Displace]( var0, "LowerBand" ) ;

  10.                          
  11.         if Displace <= 0 then
  12.                 begin
  13.                 condition1 = Low crosses under var0 ;
  14.                 if condition1 then
  15.                         Alert( "Price making new low" ) ;
  16.                 condition1 = High crosses over var1 ;
  17.                 if condition1 then
  18.                         Alert( "Price making new high" ) ;
  19.                 end ;
  20.         end ;
复制代码





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