npm.io
1.0.0 • Published 5 years ago

@reactiff/random-walk

Licence
MIT
Version
1.0.0
Deps
0
Size
11 kB
Vulns
0
Weekly
0

@reactiff/random-walk

Generates random number sequences that are more characteristic of Price Movements i.e. trending.

NPM JavaScript Style Guide

Install

yarn add @reactiff/random-walk

Usage

import RandomWalk from '@reactiff/random-walk'

const rndWalk = new RandomWalk(
    1,      // min:         number
    1000,   // max:         number
    500,    // start:       number
    10,     // maxTrend:    number - max number of steps
    10      // maxStep:     number - max step size 
);

const generatePrice = () => {
    
    console.log( rndWalk.next() );
    
    // run again after delay
    setTimeout(generatePrice, 500);
}

generatePrice();

Publishing the package to npm

# if scoped and free account
npm publish --access public

# otherwise
npm publish

to update

npm version major|minor|patch

and then simply

npm publish

License

MIT Rick Ellis