Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function stochrsi($data, $strategy)
- {
- if ($strategy->enable_stochrsi) {
- $ma_type = $this->get_ma_type($strategy->stochrsi_fastd_ma_type);
- $value = $strategy->stochrsi_value;
- $stochrsi_trend = trader_stochrsi($data['close'], $strategy->stochrsi_period, $strategy->stochrsi_fastk_period, $strategy->stochrsi_fastd_period, $ma_type);
- $fast_k = current($stochrsi_trend);
- $fast_d = end($stochrsi_trend);
- $k = end($fast_k);
- $d = end($fast_d);
- if($k <= $value && $d <= $value && $k >= $d){
- return true;
- } else{
- return false;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement