Method: Quant::Ticks::Serializers::OHLC.to_h
- Defined in:
- lib/quant/ticks/serializers/ohlc.rb
.to_h(tick) ⇒ Hash
Returns a Hash of the Spot tick’s key properties
Serialized Keys:
-
ot: open timestamp
-
ct: close timestamp
-
o: open price
-
h: high price
-
l: low price
-
c: close price
-
bv: base volume
-
tv: target volume
-
t: trades
-
g: green
-
j: doji
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/quant/ticks/serializers/ohlc.rb', line 73 def self.to_h(tick) { "ot" => tick., "ct" => tick., "o" => tick.open_price, "h" => tick.high_price, "l" => tick.low_price, "c" => tick.close_price, "bv" => tick.base_volume, "tv" => tick.target_volume, "t" => tick.trades, "g" => tick.green, "j" => tick.doji } end |