OHLCInfo.fromArray constructor

OHLCInfo.fromArray(
  1. List array
)

Constructs an instance of OHLCInfo from an array of dynamic values.

The array parameter should contain the following values in order:

  • [array0]: The timestamp in milliseconds.
  • [array1]: The opening price.
  • [array2]: The highest price.
  • [array3]: The lowest price.
  • [array4]: The closing price.

Implementation

OHLCInfo.fromArray(List<dynamic> array)
    : this.timestamp = Convert.toDateTime(array[0], Helpers.defaultDateTime(),
          unit: TimeUnit.milliseconds),
      this.open = Convert.toDouble(array[1], 0),
      this.high = Convert.toDouble(array[2], 0),
      this.low = Convert.toDouble(array[3], 0),
      this.close = Convert.toDouble(array[4], 0);