Skip to main content

qs_strategy/
lib.rs

1//! Synchronous configured strategy compilation and evaluation.
2//!
3//! The crate accepts strict, bounded, unversioned configuration and compiles it
4//! into a deterministic material graph and finite state machine. Callers own
5//! input adaptation, material libraries, command execution, and persistence.
6
7mod config;
8mod error;
9mod expression;
10mod material;
11mod runtime;
12mod value;
13
14pub use config::{
15    ActionTemplate, AssignmentConfig, BarField, ConfiguredActionKind, DecisionKind,
16    DecisionTemplate, Expr, FeedbackField, MAX_ACTIONS, MAX_ASSIGNMENTS, MAX_COMPLETED_BARS,
17    MAX_ENTRY_TARGETS, MAX_EXPR_DEPTH, MAX_EXPR_NODES, MAX_LEGS, MAX_MATERIAL_INPUTS,
18    MAX_MATERIAL_LOOKBACK, MAX_MATERIAL_STATE_BYTES, MAX_MATERIALS, MAX_NAMED_VALUES, MAX_NOTES,
19    MAX_OUTPUT_COMMANDS, MAX_OUTPUT_NOTES, MAX_PENDING_FEEDBACK, MAX_SOURCES, MAX_STATES,
20    MAX_TRANSITIONS, MAX_VARIABLES, MaterialConfig, MaterialParams, NamedExpr, NoteKind,
21    NoteTemplate, PositionField, SourceId, StateConfig, StrategyConfig, TransitionConfig,
22    VariableConfig,
23};
24pub use error::{CompileError, EvaluationError};
25pub use material::{
26    CommandFact, CommandFeedback, CommandTerminalStatus, CompletedBar, CompletedBarRequirement,
27    CompletedBarUpdate, ConfiguredStrategyRequirements, MATERIAL_ATR, MATERIAL_BAR_FIELD,
28    MATERIAL_CANCELLATION_APPLIED, MATERIAL_CANCELLATION_REJECTED, MATERIAL_CROSS_ABOVE,
29    MATERIAL_CROSS_BELOW, MATERIAL_EMA, MATERIAL_ENTRY_FILLED, MATERIAL_ENTRY_REJECTED,
30    MATERIAL_INPUT_TIME, MATERIAL_POSITION_CLOSED, MATERIAL_POSITION_ENTRY_PRICE,
31    MATERIAL_POSITION_EXISTS, MATERIAL_POSITION_OPEN, MATERIAL_POSITION_PENDING,
32    MATERIAL_POSITION_REMAINING_SIZE, MATERIAL_POSITION_SIDE, MATERIAL_POSITION_STOPLOSS,
33    MATERIAL_READINESS, MaterialBuild, MaterialEvalContext, MaterialEvaluator, MaterialFactory,
34    MaterialLibrary, MaterialLookback, MaterialUpdateTrigger, NamedInputRequirement, NamedValue,
35    StrategyInput, TradeSlotFacts, TradeSlotState,
36};
37pub use runtime::{
38    ConfiguredCommand, ConfiguredStrategy, Decision, NamedOutput, Note, OutputScalar, RelatedTrade,
39    StrategyOutput,
40};
41pub use value::{
42    Literal, MAX_GENERATED_ID_BYTES, MAX_ID_BYTES, MAX_TEXT_BYTES, ScalarType, Value, ValueType,
43};
44
45pub(crate) use config::{MAX_COMMAND_CORRELATIONS, bar_field_type};
46pub(crate) use value::{validate_id, validate_text};