use pine_core::PineOutput;
use pine_interpreter::Value;
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
pub fn register<O: PineOutput>() -> Value<O> {
let mut fields: HashMap<String, Value<O>> = HashMap::new();
fields.insert("regular".to_string(), Value::String("regular".to_string()));
fields.insert(
"extended".to_string(),
Value::String("extended".to_string()),
);
fields.insert("ismarket".to_string(), Value::Bool(true));
for off in [
"ispremarket",
"ispostmarket",
"isfirstbar",
"isfirstbar_regular",
"islastbar",
"islastbar_regular",
] {
fields.insert(off.to_string(), Value::Bool(false));
}
Value::Object {
type_name: "session".to_string(),
fields: Rc::new(RefCell::new(fields)),
call: None,
value: None,
}
}