0.0.111 • Published 7 months ago

renko-chart-ascii v0.0.111

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

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}

stonks

0.0.111

7 months ago

0.0.11

7 months ago

0.0.1

7 months ago