Backtesting ยท Lesson 3.2
Entry and exit rules
Every FactorSage strategy splits its logic into three pieces: buy signals that open positions, sell levels that scale out, and a final exit that closes the rest.
Buy signals
A buy signal is a condition group plus an allocation percentage. When the group evaluates true the simulator opens (or tops up) a position. A strategy can have multiple buy signals with different conditions and allocations.
Sell levels
Sell levels are partial-exit rules. Each one defines a percentage of the position to close when its conditions fire. They are evaluated in order, top to bottom.
Final exit
The final exit closes the remainder of any open position when its conditions fire. It is the safety net that prevents positions from lingering after the thesis breaks.
Related
- Sell levels and the final exitBacktesting
- MOS buy and MOS exitStrategy Examples
- Entry RuleGlossary
