ExPostFacto.InputData (ex_post_facto v0.2.1)
View SourceInputData a wrapper around the HLOC data that is passed into the backtest.
Summary
Functions
@spec munge(%{ optional(:high) => float(), optional(:h) => float(), optional(:low) => float(), optional(:l) => float(), optional(:open) => float(), optional(:o) => float(), optional(:close) => float(), optional(:c) => float(), optional(:timestamp) => String.t() | DateTime.t(), optional(:t) => String.t() | DateTime.t(), optional(:volume) => float(), optional(:v) => float(), optional(:other) => any() }) :: %ExPostFacto.InputData{ close: term(), high: term(), low: term(), open: term(), other: term(), timestamp: term(), volume: term() }
@spec new!(%{ optional(:other) => any(), high: float(), low: float(), open: float(), close: float(), volume: float() | nil, timestamp: String.t() | DateTime.t() | nil }) :: %ExPostFacto.InputData{ close: term(), high: term(), low: term(), open: term(), other: term(), timestamp: term(), volume: term() }
Creates a new! InputData struct.
@spec normalize_timestamp(String.t() | DateTime.t() | nil) :: DateTime.t() | String.t() | nil
Normalizes timestamp to a consistent format.
Attempts to parse string timestamps into DateTime structs for better handling.