Advertisement
ipsbruno2016

OkCoin CandleSticks three black crows

Jan 10th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. publicClient.getKline (function(error, data) {     
  3.     clandesticksData = data;
  4. }, 'btc_cny', '5min', 3);
  5.  
  6. // candlestick negativas
  7. function negativeCandle(candle){
  8.     return parseFloat(candle[1]) > parseFloat(candle[4]);
  9. }
  10.  
  11. // candlestick positivas
  12. function positiveCandle(candle) {
  13.     return !negativeCandle(candle);
  14. }
  15.  
  16. // candlesticks do tipo three black crows
  17. function blackCrows(lastcandle1, lastcandle2, lastcandle3) {
  18.  
  19.     if( !negativeCandle(lastcandle1) )
  20.         return false;
  21.     if( !negativeCandle(lastcandle2) )
  22.         return false;
  23.     if( !negativeCandle(lastcandle3) )
  24.         return false;
  25.  
  26.     return true;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement