Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $candles_not_funny = array (
  2.  
  3. 'high' => array(),
  4. 'low' => array(),
  5. 'close' => array
  6. );
  7.  
  8. $candles = array();
  9. $candleI = 0;
  10.  
  11. foreach($return as $item) {
  12.  
  13.  
  14. $time = strtotime($item['timestamp']) + $offset; // Unix time stamp
  15.  
  16. $candles_not_funny['high'][$candleI] = $item['open'];
  17. $candles_not_funny['low'][$candleI] = $item['low'];
  18. $candles_not_funny['close'][$candleI] = $item['close'];
  19.  
  20. $candles[$candleI] = array(
  21. 'timestamp' => date('Y-m-d H:i:s',$time), // Local time human-readable time stamp
  22. 'time' => $time,
  23. 'open' => $item['open'],
  24. 'high' => $item['high'],
  25. 'close' => $item['close'],
  26. 'low' => $item['low']
  27. );
  28. $candleI++;
  29. }
  30. return $candles_not_funny;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement