1. Go to this page and download the library: Download laratrade/trader library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
laratrade / trader example snippets
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);
...
}
}
php
use Laratrade\Trader\Facades\Trader;
class MyClass
{
/**
* Handle my function.
*/
public function myFunction()
{
...
$acos = Trader::acos($real);
...
}
}
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;