Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'dart:convert';
5 :
6 : class OhlcData {
7 : final DateTime date;
8 : double open;
9 : double high;
10 : double low;
11 : double close;
12 :
13 1 : OhlcData({
14 : required this.date,
15 : required this.open,
16 : required this.high,
17 : required this.low,
18 : required this.close,
19 : });
20 :
21 0 : @override
22 0 : String toString() => json.encode({
23 0 : 'date': date.toIso8601String(),
24 0 : 'open': open,
25 0 : 'high': high,
26 0 : 'low': low,
27 0 : 'close': close,
28 : });
29 : }
|