<commit_before><?php

namespace AlphaVantage\Api;

use AlphaVantage\Exception\BadMethodCallException;

/**
 * Class Indicators
 * @package AlphaVantage\Api
 *
 * @method array sma(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array ema(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array wma(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array dema(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array tema(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array trima(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array kama(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array t3(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array rsi(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array mom(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array smo(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array roc(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array rocr(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array trix(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array midpoint(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 */
class Indicators extends AbstractApi
{
    const INTERVAL_1 = '1min';
    const INTERVAL_5 = '5min';
    const INTERVAL_15 = '15min';
    const INTERVAL_30 = '30min';
    const INTERVAL_60 = '60min';
    const INTERVAL_DAILY = 'daily';
    const INTERVAL_WEEKLY = 'weekly';
    const INTERVAL_MONTHLY = 'monthly';

    const TIME_PERIOD_60 = 60;
    const TIME_PERIOD_200 = 200;

    const SERIES_TYPE_CLOSE = 'close';
    const SERIES_TYPE_OPEN = 'open';
    const SERIES_TYPE_LOW = 'low';
    const SERIES_TYPE_HIGH = 'high';

    /**
     * @param string $name
     * @param array $arguments
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        $name = strtolower($name);
        switch ($name) {
            case 'sma':
            case 'ema':
            case 'wma':
            case 'dema':
            case 'tema':
            case 'trima':
            case 'kama':
            case 't3':
            case 'rsi':
            case 'mom':
            case 'smo':
            case 'roc':
            case 'rocr':
            case 'trix':
            case 'midpoint':
                $result = call_user_func_array([$this, 'basic'], array_merge([$name], $arguments));
                break;

            default:
                throw new BadMethodCallException(
                    sprintf('Undefined method called: "%s"', $name)
                );
        }

        return $result;
    }


    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $timePeriod
     * @param string $seriesType
     * @return array
     */
    protected function basic(
        string $name,
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $timePeriod,
        string $seriesType
    ) {
        return $this->get(
            strtoupper($name),
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'time_period' => $timePeriod,
                'series_type' => $seriesType,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $timePeriod
     * @param string $seriesType
     * @param float $fastLimit
     * @param float $slowLimit
     * @return array
     */
    public function mama(
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $timePeriod,
        string $seriesType,
        float $fastLimit = 0.01,
        float $slowLimit = 0.01
    ) {
        return $this->get(
            'MAMA',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'time_period' => $timePeriod,
                'series_type' => $seriesType,
                'fastlimit' => $fastLimit,
                'slowlimit' => $slowLimit,
            ]
        );
    }
}<commit_msg>added more indicators methods<commit_after><?php

namespace AlphaVantage\Api;

use AlphaVantage\Exception\BadMethodCallException;

/**
 * Class Indicators
 * @package AlphaVantage\Api
 *
 * @method array sma(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array ema(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array wma(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array dema(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array tema(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array trima(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array kama(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array t3(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array rsi(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array mom(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array smo(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array roc(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array rocr(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array trix(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array midpoint(string $symbolName, string $exchangeName, string $interval, int $timePeriod, string $seriesType)
 * @method array willr(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array adx(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array adxr(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array cci(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array aroon(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array aroonosc(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array mfi(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array dx(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array minusDi(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array plusDi(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array minusDm(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array midprice(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array atr(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array natr(string $symbolName, string $exchangeName, string $interval, int $timePeriod)
 * @method array bop(string $symbolName, string $exchangeName, string $interval)
 * @method array trange(string $symbolName, string $exchangeName, string $interval)
 * @method array ad(string $symbolName, string $exchangeName, string $interval)
 * @method array obv(string $symbolName, string $exchangeName, string $interval)
 * @method array htTrendline(string $symbolName, string $exchangeName, string $interval, string $seriesType)
 * @method array htSine(string $symbolName, string $exchangeName, string $interval, string $seriesType)
 * @method array htTrendmode(string $symbolName, string $exchangeName, string $interval, string $seriesType)
 * @method array htDcPeriod(string $symbolName, string $exchangeName, string $interval, string $seriesType)
 * @method array htDcPhase(string $symbolName, string $exchangeName, string $interval, string $seriesType)
 * @method array htPhasor(string $symbolName, string $exchangeName, string $interval, string $seriesType)
 */
class Indicators extends AbstractApi
{
    const INTERVAL_1 = '1min';
    const INTERVAL_5 = '5min';
    const INTERVAL_15 = '15min';
    const INTERVAL_30 = '30min';
    const INTERVAL_60 = '60min';
    const INTERVAL_DAILY = 'daily';
    const INTERVAL_WEEKLY = 'weekly';
    const INTERVAL_MONTHLY = 'monthly';

    const TIME_PERIOD_60 = 60;
    const TIME_PERIOD_200 = 200;

    const SERIES_TYPE_CLOSE = 'close';
    const SERIES_TYPE_OPEN = 'open';
    const SERIES_TYPE_LOW = 'low';
    const SERIES_TYPE_HIGH = 'high';

    /**
     * @param string $name
     * @param array $arguments
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        $name = strtolower($name);

        switch ($name) {
            case 'sma':
            case 'ema':
            case 'wma':
            case 'dema':
            case 'tema':
            case 'trima':
            case 'kama':
            case 't3':
            case 'rsi':
            case 'mom':
            case 'cmo':
            case 'roc':
            case 'rocr':
            case 'trix':
            case 'midpoint':
                $result = call_user_func_array([$this, 'basic'], array_merge([$name], $arguments));
                break;

            case 'willr':
            case 'adx':
            case 'adxr':
            case 'cci':
            case 'aroon':
            case 'aroonosc':
            case 'mfi':
            case 'dx':
            case 'midprice':
            case 'atr':
            case 'natr':
                $result = call_user_func_array([$this, 'basicTimePeriod'], array_merge([$name], $arguments));
                break;

            case 'minusdi':
                $result = call_user_func_array([$this, 'basicTimePeriod'], array_merge(['minus_di'], $arguments));
                break;

            case 'plusdi':
                $result = call_user_func_array([$this, 'basicTimePeriod'], array_merge(['plus_di'], $arguments));
                break;

            case 'minusdm':
                $result = call_user_func_array([$this, 'basicTimePeriod'], array_merge(['minus_dm'], $arguments));
                break;

            case 'plusdm':
                $result = call_user_func_array([$this, 'basicTimePeriod'], array_merge(['plus_dm'], $arguments));
                break;

            case 'bop':
            case 'trange':
            case 'ad':
            case 'obv':
                $result = call_user_func_array([$this, 'basicInterval'], array_merge([$name], $arguments));
                break;

            case 'httrendline':
                $result = call_user_func_array([$this, 'basicSeriesType'], array_merge(['ht_trendline'], $arguments));
                break;

            case 'htsine':
                $result = call_user_func_array([$this, 'basicSeriesType'], array_merge(['ht_sine'], $arguments));
                break;

            case 'httrendmode':
                $result = call_user_func_array([$this, 'basicSeriesType'], array_merge(['ht_trendmode'], $arguments));
                break;

            case 'htdcperiod':
                $result = call_user_func_array([$this, 'basicSeriesType'], array_merge(['ht_dcperiod'], $arguments));
                break;

            case 'htphasor':
                $result = call_user_func_array([$this, 'basicSeriesType'], array_merge(['ht_phasor'], $arguments));
                break;

            case 'htdcphase':
                $result = call_user_func_array([$this, 'basicSeriesType'], array_merge(['ht_dcphase'], $arguments));
                break;



            default:
                throw new BadMethodCallException(
                    sprintf('Undefined method called: "%s"', $name)
                );
        }

        return $result;
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $timePeriod
     * @param string $seriesType
     * @param float $fastLimit
     * @param float $slowLimit
     * @return array
     */
    public function mama(
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $timePeriod,
        string $seriesType,
        float $fastLimit = 0.01,
        float $slowLimit = 0.01
    ) {
        return $this->get(
            'MAMA',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'time_period' => $timePeriod,
                'series_type' => $seriesType,
                'fastlimit' => $fastLimit,
                'slowlimit' => $slowLimit,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param string $seriesType
     * @param int $fastPeriod
     * @param int $slowPeriod
     * @param int $signalPeriod
     * @return array
     */
    public function macd(
        string $symbolName,
        string $exchangeName,
        string $interval,
        string $seriesType,
        int $fastPeriod = 12,
        int $slowPeriod = 26,
        int $signalPeriod = 9
    ) {
        return $this->get(
            'MACD',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'series_type' => $seriesType,
                'fastperiod' => $fastPeriod,
                'slowperiod' => $slowPeriod,
                'signalperiod' => $signalPeriod,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param string $seriesType
     * @param int $fastPeriod
     * @param int $slowPeriod
     * @param int $signalPeriod
     * @return array
     */
    public function macdext(
        string $symbolName,
        string $exchangeName,
        string $interval,
        string $seriesType,
        int $fastPeriod = 12,
        int $slowPeriod = 26,
        int $signalPeriod = 9,
        int $fastMaType = 0,
        int $slowMaType = 0,
        int $signalMaType = 0
    ) {
        return $this->get(
            'MACDEXT',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'series_type' => $seriesType,
                'fastperiod' => $fastPeriod,
                'slowperiod' => $slowPeriod,
                'signalperiod' => $signalPeriod,
                'fastmatype' => $fastMaType,
                'slowmatype' => $slowMaType,
                'signalmatype' => $signalMaType,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $fastKPeriod
     * @param int $slowKPeriod
     * @param int $slowDPeriod
     * @param int $slowKmaType
     * @param int $slowDmaType
     * @return array
     */
    public function stoch(
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $fastKPeriod = 5,
        int $slowKPeriod = 3,
        int $slowDPeriod = 3,
        int $slowKmaType = 0,
        int $slowDmaType = 0
    ) {
        return $this->get(
            'STOCH',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'fastkperiod' => $fastKPeriod,
                'slowkperiod' => $slowKPeriod,
                'slowdperiod' => $slowDPeriod,
                'slowkmatype' => $slowKmaType,
                'slowdmatype' => $slowDmaType,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $fastKPeriod
     * @param int $fastDPeriod
     * @param int $fastDmaPeriod
     * @return array
     */
    public function stochf(
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $fastKPeriod = 5,
        int $fastDPeriod = 3,
        int $fastDmaPeriod = 0
    ) {
        return $this->get(
            'STOCHF',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'fastkperiod' => $fastKPeriod,
                'fastdperiod' => $fastDPeriod,
                'fastdmatype' => $fastDmaPeriod,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $fastKPeriod
     * @param int $fastDPeriod
     * @param int $fastDmaPeriod
     * @return array
     */
    public function stochrsi(
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $timePeriod,
        string $seriesType,
        int $fastKPeriod = 5,
        int $fastDPeriod = 3,
        int $fastDmaPeriod = 0
    ) {
        return $this->get(
            'STOCHRSI',
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'time_period' => $timePeriod,
                'series_type' => $seriesType,
                'fastkperiod' => $fastKPeriod,
                'fastdperiod' => $fastDPeriod,
                'fastdmatype' => $fastDmaPeriod,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $timePeriod
     * @param string $seriesType
     * @return array
     */
    protected function basic(
        string $name,
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $timePeriod,
        string $seriesType
    ) {
        return $this->get(
            strtoupper($name),
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'time_period' => $timePeriod,
                'series_type' => $seriesType,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param int $timePeriod
     * @return array
     */
    protected function basicTimePeriod(
        string $name,
        string $symbolName,
        string $exchangeName,
        string $interval,
        int $timePeriod
    ) {
        return $this->get(
            strtoupper($name),
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'time_period' => $timePeriod,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @param string $seriesType
     * @return array
     */
    protected function basicSeriesType(
        string $name,
        string $symbolName,
        string $exchangeName,
        string $interval,
        string $seriesType
    ) {
        return $this->get(
            strtoupper($name),
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
                'series_type' => $seriesType,
            ]
        );
    }

    /**
     * @param string $symbolName
     * @param string $exchangeName
     * @param string $interval
     * @return array
     */
    protected function basicInterval(
        string $name,
        string $symbolName,
        string $exchangeName,
        string $interval
    ) {
        return $this->get(
            strtoupper($name),
            $symbolName,
            $exchangeName,
            [
                'interval' => $interval,
            ]
        );
    }

}
{'fraction_non_alphanumeric': 0.11202564961477723, 'fraction_numerical': 0.004402545819974159, 'mean_word_length': 2.1702063106796117, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4855757', 'n_tokens_mistral': 6084, 'n_tokens_neox': 5761, 'n_words': 1562}