1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#[derive(Debug)] pub struct Candlestick<Instrument, Interval, Time, Price, Volume> { pub instrument: Instrument, pub interval: Interval, pub time: Time, pub open: Price, pub high: Price, pub low: Price, pub close: Price, pub volume: Volume, } impl<Instrument, Interval, Time, Price, Volume> Candlestick<Instrument, Interval, Time, Price, Volume> { pub fn new( instrument: Instrument, interval: Interval, time: Time, open: Price, high: Price, low: Price, close: Price, volume: Volume, ) -> Candlestick<Instrument, Interval, Time, Price, Volume> { Candlestick { instrument, interval, time, open, high, low, close, volume, } } }