이것은 TA-LIB C/Java 코드의 포트 인 PHP의 Trader Extension의 PHP 포트입니다.
이 포트는 PHP로 작성되었으며 다른 요구 사항이 없습니다.
목표는이 라이브러리가 PHP 트레이더 확장을 설치할 수없는 사람들이 사용할 수 있다는 것입니다.
그것이 당신이 필요한 유일한 것입니다! 언급 한 바와 같이,이 라이브러리에 대한 확장자를 설치할 필요는 없습니다.
이 라이브러리는 작곡가와 함께 설치되도록 고안되었습니다.
composer require lupecode/php-trader-native
이 라이브러리는 트레이더 확장을위한 드롭 인 대체품으로, 트레이더 확장을위한 폴리 필과 함께 제공됩니다.
이 패키지가 제공하는 또 다른 옵션은 이름을 이해하기 쉬운 기능을 사용하는 것입니다.
ADOSC가 충분히 설명하지 않기 때문에 adosc 사용하지 않으려면 다음과 같이 chaikinAccumulationDistributionOscillator 사용할 수 있습니다 :: TraderFriendly::chaikinAccumulationDistributionOscillator($high, $low, $close, $volume, $fastPeriod, $slowPeriod)
TA-LIB의 "Trader"의 PECL 버전에는 함수에 대한 올바른 기본값이 없습니다. 빠른 모양은 많은 함수가 C/Java 버전의 TA-LIB에 사용되는 기본값 대신 선택적 매개 변수의 최소값을 사용 함을 보여줍니다. PECL Trader 라이브러리가 C/Java 코드와 다른 기본값을 사용하는 한 testAdOscDefaultsDifferent Pass와 같은 일부 테스트는 패스입니다.
호기심을 위해, ADOSC의 TA-LIB 소스는 3과 10의 기본값으로 여기에서 볼 수 있으며, PECL 트레이더 소스는 2와 2의 기본값으로 볼 수 있습니다.
이 패키지는 PECL 기본값이 아닌 C/Java 기본값을 사용합니다.
이 라이브러리는 순수한 PHP로 작성되며 C로 작성된 PECL 확장보다 느리게 실행됩니다. 내 벤치 마크는 기능에 따라 5x ~ 30 배 느리고 느리게 제공됩니다.
최적화에 대한 도움을 환영합니다! 이 라이브러리를 최적화하기 위해 노력하지 않았습니다. C에서 PHP로 간단한 전환입니다.
저장소를 체크 아웃 한 다음 작곡가로 설치하십시오.
git checkout [email protected]:LupeCode/phpTraderNative.git
cd phpTraderNative
composer install --dev
source - 라이브러리의 소스 코드.tests - 라이브러리의 PHPUnit 테스트.pecl -PECL 트레이더 확장 소스 코드.talib PECL 트레이더 확장이 사용하는 TA -LIB 소스 코드.두 개의 phpunit XML 파일이 포함되어 있으며, 하나는 테스트 용이고 다른 하나는 적용 범위를위한 것입니다. 이는 일부 테스트가 커버리지로 실행되면 PHP가 매달려서 끝나지 않기 때문입니다.
사용하여 테스트를 실행하십시오
php -dxdebug.coverage_enable=0 ./vendor/phpunit/phpunit/phpunit --configuration ./phpunit.xml ./tests
사용을 사용하여 적용 범위를 실행하십시오
php -dxdebug.coverage_enable=1 ./vendor/phpunit/phpunit/phpunit --configuration ./phpunit_coverage.xml ./tests
아래는 소스 코드에있는 TA-LIB의 저작권 정보입니다.
TA-LIB Copyright (c) 1999-2007, Mario Fortier
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither name of author nor the names of its contributors may be used
to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
아래는 코드를 PHP로 포팅하는 라이센스입니다.
MIT License
Copyright (C) Lupe Code, LLC.; Joshua Lopez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.