0.0.1 • Published 8 months ago

indicator-volume-profile v0.0.1

Weekly downloads
-
License
GPL
Repository
-
Last release
8 months ago

indicator-volume-profile

big pile of data related to volume profile

experimental, use at your own risk

Installation

npm i indicator-volume-profile

Usage

var candles = require('candles-sample-aapl').loadNMinuteCandles(60).slice(50);

var VolumeProfile = require('indicator-volume-profile').VolumeProfile;
let nValues = [20]; // Compute profiles for these N values
var nBuckets = 10;
let volumeProfileCalculator = new VolumeProfile(candles, nValues, nBuckets, true); // Set normalize to true
let updatedCandles = volumeProfileCalculator.computeVolumeProfiles();
console.log(updatedCandles.slice(-1)[0].volumeProfile['20']);

// {
//     imbalanceAtPrice: 0.1388207255289321,
//     imbalanceAtPriceAbove: -0.023302524236367157,
//     imbalanceAtPriceBelow: 0.1645874882401388,
//     imbalanceSlope: -0.18789001247650597,
//     centroidPrice: 144.83775,
//     priceRelativeToCentroid: 1.0215568800260981,
//     priceRelativeToCentroidStd: 0.753666043087322,
//     priceRelativeToCentroidLog2: 0.030769535198874303,
//     priceRelativeToVPOC: 1.0516365187106864,
//     priceRelativeToVPOCStd: 1.753666043087322,
//     priceRelativeToVPOCLog2: 0.0726361463915623,
//     stdSize: 4.142750000000007,
//     high: 148.9805, //high across profile
//     low: 140.695,  //high across profile
//     valueArea: [ 140.695, 146.49485 ],
//     BorP_signal: 0.3500000000000007,
//     percentiles: {
//             open: 0.7865904435389365,
//             high: 1.0464636022568983,
//             low: 0.7865904435389365,
//             close: 1.0464636022568983
//     },
//     percentilePrices: { '16': 140.695, '50': 144.83775, '84': 146.49485 },
//     volumeSlope: -0.181293577210192,
//         volumePercentileHorizontal: 1,
//     VPOC: 140.695,
//     rmseProfileToVPOCStd: 1.1663397176416133,
//     rmseProfileToPriceStd: 1.0067546629990218,
//     profile: [
//         0.29249485218654153,
//         0.10504904296302717,
//         0.01390832568628771,
//         0.01390832568628771,
//         0.040135543168855155,
//         0.040135543168855155,
//         0.2809588106790821,
//         0.25987315871796185,
//         0.23728898010494626,
//         0.07857958150776986
//     ],
//     profileBull: [
//         0.22412124879341325,
//         0.06491198573861917,
//         0.01390832568628771,
//         0.01390832568628771,
//         0.040135543168855155,
//         0.040135543168855155,
//         0.20679630436343044,
//         0.21223032347905033,
//         0.18805485281693918,
//         0.02763852863570135
//     ],
//     profileBear: [
//         0.06837360339312827,
//         0.040137057224407996,
//         0,
//         0,
//         0,
//         0,
//         0.0741625063156517,
//         0.047642835238911524,
//         0.04923412728800708,
//         0.05094105287206851
//     ]
// }

stonks

0.0.1

8 months ago