forge.prop
Forge API 1
Prop-firm rules a strategy is judged by: ``fg.prop``.
A strategy declares the rules it is tested against, either a named firm's rules (``fg.prop.preset``) or its own (``fg.prop.Rules``), as the class attribute ``prop``. The engine enforces them and the engine's action always wins: a strategy that keeps trading after a breach is stopped, flattened or failed as the rule says. The presets are Forge's dated library of firm rules, and a preset states when it was last checked. This module is imported by a strategy, so it never imports ``btpro``.
| Name | Kind | Summary |
|---|---|---|
| BREACH | constant | |
| BestDay | class | No one day may be more than this share of the profit. |
| DailyLoss | class | The most the account may lose in a day: a percent or an amount, from the day's own start. |
| MaxLoss | class | The most the account may lose in all: static, or trailing behind the balance or the equity. |
| MaxRequests | class | At most this many requests to the broker in a day. |
| NoFloorAsStop | class | Never use the account's loss floor as the stop. |
| NoHedging | class | No opposite positions on one instrument at once. |
| NoMartingale | class | No sizing that doubles up after a loss. |
| NoNews | class | Do not hold trades through the news window around a release. |
| NoNewsBrackets | class | No pending orders placed around a news release. |
| NoOvernight | class | No trade open overnight. |
| NoWeekendHold | class | No trade open over the weekend. |
| ON_BREACH | constant | |
| Phase | class | One phase of an evaluation: a profit target, with the days it needs. |
| Preset | class | A named firm's rules from Forge's dated library, as ``prop = fg.prop.preset("ftmo-2step")``. |
| RequireStop | class | Every trade carries a stop. |
| Rules | class | Custom prop-firm rules, as the class attribute ``prop = fg.prop.Rules(...)``. |
| Scaling | class | A table of the lots the account may trade as its balance grows. |
| WARN_AT | constant | |
| preset | function | A named firm's rules from Forge's library, like ``fg.prop.preset("ftmo-2step", size=100_000)``. |