Download the PHP package adnanhussainturki/dhan-php without Composer
On this page you can find all versions of the php package adnanhussainturki/dhan-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download adnanhussainturki/dhan-php
More information about adnanhussainturki/dhan-php
Files in adnanhussainturki/dhan-php
Download adnanhussainturki/dhan-php
More information about adnanhussainturki/dhan-php
Files in adnanhussainturki/dhan-php
Vendor adnanhussainturki
Package dhan-php
Short Description PHP Wrapper for Dhan Trading API
License MIT
Package dhan-php
Short Description PHP Wrapper for Dhan Trading API
License MIT
Please rate this library. Is it a good library?
Informations about the package dhan-php
adnanhussainturki/dhan-php
PHP Wrapper for Dhan Trading API
Installation
Install the package via Composer:
composer require adnanhussainturki/dhan-php
Requirements
- PHP >= 7.4
- Guzzle HTTP client
Usage
Initialize the Dhan client:
// Initialize Dhan client
$dhan = new Dhan($clientId, $accessToken);
Example usage:
// Place an order
$newOrder = new NewOrder();
$newOrder->setTransactionType(TransactionType::BUY);
$newOrder->setSecurityId("505685"); // TAPARIA
$newOrder->setQuantity(1);
$newOrder->setPrice(3.21);
$newOrder->setOrderType(OrderType::LIMIT);
$newOrder->setExchangeSegment(ExchangeSegment::BSE_EQ);
$newOrder->setProductType(ProductType::CNC);
$newOrder->setValidity(OrderValidity::DAY);
try {
$orderManager->placeOrder($newOrder);
} catch (\Throwable $th) {
echo "ERROR: " . $th->getMessage() . "\n";
}
License
MIT License
Author
Adnan Hussain Turki [email protected]
All versions of dhan-php with dependencies
PHP Build Version
Package Version
Requires
guzzlehttp/guzzle Version
^7.8
The package adnanhussainturki/dhan-php contains the following files
Loading the files please wait ...