dev-master
9999999-devStock-Faker is a PHP library that generates fake stock data for you.
MIT
The Requires
- php ^5.3.3|^7.0
- fzaninotto/faker ^1.6
- larsbadke/stock-simulator ^0.2.0
The Development Requires
by Lars Badke
fixtures faker data stock
Wallogit.com
2017 © Pedro Peláez
Stock-Faker is a PHP library that generates fake stock data for you.
Stock-Faker is a PHP library that generates stock fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Stock-Faker is for you., (*1)
Stock-Faker requires PHP >= 5.3.3., (*2)
composer require larsbadke/stock-faker
Use StockFaker\Factory::create() to create and initialize Stock-Faker, now you can generate data by accessing properties named after the type of data you want., (*3)
<?php // use the factory to create a StockFaker instance $stock = StockFaker\Factory::create(); echo $stock->name; // "Predovic LLC" echo $stock->isin; // "US0378331005" echo $stock->close; // '18.45' echo $stock->open; // "18.02" echo $stock->low; // '17.65' echo $stock->high; // "18.92"
Stock key figures, (*4)
<?php $stock = StockFaker\Factory::create(); echo $stock->variance; // 4.56 echo $stock->mu; // 3.45
Single movement, (*5)
<?php $stock = StockFaker\Factory::create(); echo $stock->close; // "54.45" $stock->next(); echo $stock->close; // "55.45"
Complete movement like an impulse or a trend, (*6)
<?php
$stock = StockFaker\Factory::create();
for($i=0; $i<70; $i++){
echo $stock->close;
$stock->next();
}
// Generates random stock data
// 131.3
// 132.68
// 133.4
// 134.45
// 136.26
// 137.89
// 138.16
// 138.87
// 140.28
// 142.38
// ...
, (*7)
Manipulate drift and volatility, (*8)
<?php
$stock = StockFaker\Factory::create();
$stock->drift(0.01);
$stock->volatility(0.1);
for($i=0;$i<20;$i++){
echo $stock->close.'<br>';
$stock->next();
}
Stock-Faker is released under the MIT Licence. See the bundled LICENSE file for details., (*9)
Stock-Faker is a PHP library that generates fake stock data for you.
MIT
fixtures faker data stock