Download the PHP package zyan/stock-generate without Composer
On this page you can find all versions of the php package zyan/stock-generate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package stock-generate
English Documentation for zyan/stock-generate
English | 中文
Overview
The zyan/stock-generate
package is designed to simulate and generate stock data based on configurable parameters. It allows developers to create realistic stock price movements, including limit up (price increase cap), limit down (price decrease cap), and normal fluctuations.
Requirements
- PHP version >= 7.4
- Composer version 2.x
Installation
To install the package via Composer, run the following command in your terminal:
Usage
Below is an example of how to use the StockGenerate
class to simulate stock data:
Key Features
-
Customizable Parameters:
- Define stock symbol, name, start/end dates, initial price, and probability percentages.
- Configure limit up/down percentages and maximum consecutive limit up/down days.
-
Holiday and Weekend Handling:
- The generator automatically skips weekends and holidays defined in the
holidays
array.
- The generator automatically skips weekends and holidays defined in the
-
Random Price Fluctuations:
- Simulates daily price changes based on random probabilities within specified limits.
- Output Format:
- Generates a list of daily stock data, including date, price, change amount, and percentage change.
Example Output
Here’s an example of the generated stock data:
Contributing
- Fork the repository to your account.
- Make your changes locally, review them, and push to your forked repository.
- Submit a Pull Request (PR) with a description of your changes, and wait for it to be reviewed and merged.
License
This package is released under the MIT License. See the LICENSE file for more details.
Let me know if you need further adjustments or additional sections!
All versions of stock-generate with dependencies
ext-json Version *