mod bar;
mod library;
mod output;
mod series_buffer;
mod syminfo;
mod timeframe;
mod version;
pub use bar::{Bar, Data, Ohlcv};
pub use library::{DirLoader, FileResolver, LibraryLoader};
pub use output::{
AlertCondition, AlertConditionOutput, BoxOutput, Color, DefaultPineOutput, DrawingOutput,
FillObject, FillOutput, Frequency, GlobalContext, GlobalOutput, Indicator, Input, InputOutput,
InputValue, Label, LabelOutput, Library, LineObject, LineOutput, LinefillObject, LogEntry,
LogLevel, LogOutput, MetadataOutput, PineBox, PineOutput, Plot, PlotOutput, Plotarrow, Plotbar,
Plotcandle, Plotchar, Plotshape, PolylineObject, Table, TableCell, TableOutput,
};
pub use series_buffer::{SeriesBuffer, MAX_LOOKBACK};
pub use syminfo::SymInfo;
pub use timeframe::{Timeframe, TimeframeError, TimeframeUnit};
pub use version::{PineVersion, VersionError};
pub type ProviderError = Box<dyn std::error::Error + Send + Sync>;
#[derive(Debug, Clone)]
pub struct FootprintRow {
pub down_price: f64,
pub up_price: f64,
pub buy_volume: f64,
pub sell_volume: f64,
}
pub trait DataProvider {
fn request(&self, symbol: &str, timeframe: Timeframe) -> Result<Data, ProviderError>;
fn footprint(
&self,
_ticks_per_row: f64,
_va_percent: f64,
_imbalance_percent: f64,
) -> Option<Vec<FootprintRow>> {
None
}
fn financial(&self, _symbol: &str, _id: &str, _period: &str) -> Option<f64> {
None
}
fn dividends(&self, _ticker: &str, _field: &str) -> Option<f64> {
None
}
fn earnings(&self, _ticker: &str, _field: &str) -> Option<f64> {
None
}
fn splits(&self, _ticker: &str, _field: &str) -> Option<f64> {
None
}
fn economic(&self, _country: &str, _field: &str) -> Option<f64> {
None
}
fn currency_rate(&self, _from: &str, _to: &str) -> Option<f64> {
None
}
}