dakshhmehta / php-tradebook
dev-main
2022-12-27 09:43 UTC
Requires
Requires (Dev)
- phpunit/phpunit: ^9.5
README
Example
use Dakshhmehta\PhpTradebook\Trade; use Dakshhmehta\PhpTradebook\TradeBook; $tradebook = new TradeBook([ new Trade([ 'id' => 2, 'symbol' => 'TCS', 'date' => '2022-09-26', 'qty' => 5, 'type' => 'buy', ]), new Trade([ 'id' => 1, 'symbol' => 'TCS', 'date' => '2022-10-24', 'qty' => 10, 'type' => 'buy', ]), new Trade([ 'id' => 3, 'symbol' => 'TCS', 'date' => '2022-09-19', 'qty' => 5, 'type' => 'sell', ]), ]); $trades = $tradebook->getTrades(); $ledger = $tradebook->getLedger(); echo $tradebook->getHolding();