renko-chart-ascii
v0.0.111
Published
draw renko-style charts in ascii given a string like 'ABAAABB' representing up/down movements
Downloads
1
Readme
renko-chart-ascii
draw renko-style "up/down brick charts" in ascii given a string of characters like ABAAABB
representing up/down movements
Installation
npm i renko-chart-ascii
Usage
var drawRenko = require('renko-chart-ascii').drawRenko;
// Example usage:
//drawRenko(inputString, up="/", down="\\", horizontal=false, flipCharsOnOutput=false)
console.log(drawRenko("AAABBBBBB","A","B"));
console.log(drawRenko("AAABBBBBB","A","B",true));
//vertical
//price →
//time ↓
/*
A
A
A
B
B
B
B
B
B
//horizontal
//time →
//price ↑
AB
A B
A B
B
B
B
*/
//note that if you use diagonal lines like this, the up/down chars on the output must be flipped for the vertical format!
console.log(drawRenko("///\\\\\\\\","/","\\", false, true));
console.log(drawRenko("///\\\\\\\\","/","\\", true));
/*
\
\
\
/
/
/
/
/\
/ \
/ \
\
*/
// also includes convenience functions for manipulating strings ...
// {drawRenko, flipTextHorizontally, flipTextVertically, rotateText, flipRenkoValues}