Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1.  public function stochrsi($data, $strategy)
  2.     {
  3.         if ($strategy->enable_stochrsi) {
  4.             $ma_type = $this->get_ma_type($strategy->stochrsi_fastd_ma_type);
  5.             $value = $strategy->stochrsi_value;
  6.  
  7.             $stochrsi_trend = trader_stochrsi($data['close'], $strategy->stochrsi_period, $strategy->stochrsi_fastk_period, $strategy->stochrsi_fastd_period, $ma_type);
  8.  
  9.  
  10.             $fast_k = current($stochrsi_trend);
  11.             $fast_d = end($stochrsi_trend);
  12.  
  13.             $k = end($fast_k);
  14.             $d = end($fast_d);
  15.            
  16.  
  17.             if($k <= $value && $d <= $value && $k >= $d){
  18.                 return true;
  19.             } else{
  20.                 return false;
  21.             }
  22.         }
  23.         return true;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement