Laravel package for trader extension interface.
Make sure all dependencies have been installed before moving on:
Pull the package via Composer:
$ composer require laratrade/trader
Via dependency injection
<?php
use Laratrade\Trader\Contracts\Trader;
class MyClass
{
/**
* The trader instance.
*
* @var Trader
*/
protected $trader;
/**
* Create a new instance.
*
* @param Trader $trader
*/
public function __construct(Trader $trader)
{
$this->indicatorManager = $trader;
}
/**
* Handle my function.
*/
public function myFunction()
{
...
$acos = $this->trader->acos($real);
...
}
}
Via facade
<?php
use Laratrade\Trader\Facades\Trader;
class MyClass
{
/**
* Handle my function.
*/
public function myFunction()
{
...
$acos = Trader::acos($real);
...
}
}
Via helper
<?php
class MyClass
{
/**
* Handle my function.
*/
public function myFunction()
{
...
$acos = trader()->acos($real);
...
}
}
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_SMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_EMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_WMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_DEMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_TEMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_TRIMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_KAMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_MAMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::MA_TYPE_T3;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::REAL_MIN;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::REAL_MAX;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_ADX;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_ADXR;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_ATR;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_CMO;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_DX;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_EMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_HT_DCPERIOD;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_HT_DCPHASE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_HT_PHASOR;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_HT_SINE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_HT_TRENDLINE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_HT_TRENDMODE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_KAMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_MAMA;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_MFI;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_MINUS_DI;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_MINUS_DM;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_NATR;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_PLUS_DI;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_PLUS_DM;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_RSI;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_STOCHRSI;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_T3;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_ALL;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::FUNC_UNST_NONE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::COMPATIBILITY_DEFAULT;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::COMPATIBILITY_METASTOCK;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_SUCCESS;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_LIB_NOT_INITIALIZE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_BAD_PARAM;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_ALLOC_ERR;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_GROUP_NOT_FOUND;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_FUNC_NOT_FOUND;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INVALID_HANDLE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INVALID_PARAM_HOLDER;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INVALID_PARAM_HOLDER_TYPE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INVALID_PARAM_FUNCTION;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INPUT_NOT_ALL_INITIALIZE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_OUTPUT_NOT_ALL_INITIALIZE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_OUT_OF_RANGE_START_INDEX;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_OUT_OF_RANGE_END_INDEX;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INVALID_LIST_TYPE;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_BAD_OBJECT;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_NOT_SUPPORTED;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_INTERNAL_ERROR;
<?php
use Laratrade\Trader\Contracts\Trader;
echo Trader::ERR_UNKNOWN_ERROR;
Vector Trigonometric ACos
$acos = Trader::acos($real);
Chaikin A/D Line
$ad = Trader::ad($real);
Vector Arithmetic Add
$add = Trader::add($real);
Chaikin A/D Oscillator
$add = Trader::add($real);
Average Directional Movement Index
$adx = Trader::adx($real);
Average Directional Movement Index Rating
$adx = Trader::adx($real);
Absolute Price Oscillator
$adx = Trader::apo($real);
Aroon
Aroon Oscillator
Vector Trigonometric ASin
Vector Trigonometric ATan
Average True Range
Average Price
Bollinger Bands
Beta
Balance Of Power
Commodity Channel Index
Two Crows
Three Black Crows
Three Inside Up/Down
Three-Line Strike
Three Outside Up/Down
Three Stars In The South
Three Advancing White Soldiers
Abandoned Baby
Advance Block
Belt-hold
Breakaway
Closing Marubozu
Concealing Baby Swallow
Counterattack
Dark Cloud Cover
Doji
Doji Star
Dragonfly Doji
Engulfing Pattern
Evening Doji Star
Evening Star
Up/Down-gap side-by-side white lines
Gravestone Doji
Hammer
Hanging Man
Harami Pattern
Harami Cross Pattern
High-Wave Candle
Hikkake Pattern
Modified Hikkake Pattern
Homing Pigeon
Identical Three Crows
In-Neck Pattern
Inverted Hammer
Kicking
Kicking - bull/bear determined by the longer marubozu
Ladder Bottom
Long Legged Doji
Long Line Candle
Marubozu
Matching Low
Mat Hold
Morning Doji Star
Morning Star
On-Neck Pattern
Piercing Pattern
Rickshaw Man
Rising/Falling Three Methods
Separating Lines
Shooting Star
Short Line Candle
Spinning Top
Stalled Pattern
Stick Sandwich
Takuri (Dragonfly Doji with very long lower shadow)
Tasuki Gap
Thrusting Pattern
Tristar Pattern
Unique 3 River
Upside Gap Two Crows
Upside/Downside Gap Three Methods
Vector Ceil
Chande Momentum Oscillator
Pearson's Correlation Coefficient (r)
Vector Trigonometric Cos
Vector Trigonometric Cosh
Double Exponential Moving Average
Vector Arithmetic Div
Directional Movement Index
Exponential Moving Average
Get error code
Vector Arithmetic Exp
Vector Floor
Get compatibility mode
Get unstable period
Hilbert Transform - Dominant Cycle Period
Hilbert Transform - Dominant Cycle Phase
Hilbert Transform - Phasor Components
Hilbert Transform - SineWave
Hilbert Transform - Instantaneous Trendline
Hilbert Transform - Trend vs Cycle Mode
Kaufman Adaptive Moving Average
Linear Regression Angle
Linear Regression Intercept
Linear Regression Slope
Linear Regression
Vector Log Natural
Vector Log10
Moving average
Moving Average Convergence/Divergence
MACD with controllable MA type
Moving Average Convergence/Divergence Fix 12/26
MESA Adaptive Moving Average
Moving average with variable period
Highest value over a specified period
Index of highest value over a specified period
Median Price
Money Flow Index
MidPoint over period
Midpoint Price over period
Lowest value over a specified period
Index of lowest value over a specified period
Lowest and highest values over a specified period
Indexes of lowest and highest values over a specified period
Minus Directional Indicator
Minus Directional Movement
Momentum
Vector Arithmetic Mult
Normalized Average True Range
On Balance Volume
Plus Directional Indicator
Plus Directional Movement
Percentage Price Oscillator
Rate of change : ((price/prevPrice)-1)*100
Rate of change Percentage: (price-prevPrice)/prevPrice
Rate of change ratio 100 scale: (price/prevPrice)*100
Rate of change ratio: (price/prevPrice)
Relative Strength Index
Parabolic SAR
Parabolic SAR - Extended
Set compatibility mode
Set unstable period
Vector Trigonometric Sin
Vector Trigonometric Sinh
Simple Moving Average
Vector Square Root
Standard Deviation
Stochastic
Stochastic Fast
Stochastic Relative Strength Index
Vector Arithmetic Subtraction
Summation
Triple Exponential Moving Average (T3)
Vector Trigonometric Tan
Vector Trigonometric Tanh
Triple Exponential Moving Average
True Range
Triangular Moving Average
1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
Time Series Forecast
Typical Price
Ultimate Oscillator
Variance
Weighted Close Price
Williams' %R
Weighted Moving Average
$ composer test
If you discover any security related issues, please use the issue tracker.
The MIT License (MIT). Please see License File for more information.