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``.

NameKindSummary
BREACHconstant
BestDayclassNo one day may be more than this share of the profit.
DailyLossclassThe most the account may lose in a day: a percent or an amount, from the day's own start.
MaxLossclassThe most the account may lose in all: static, or trailing behind the balance or the equity.
MaxRequestsclassAt most this many requests to the broker in a day.
NoFloorAsStopclassNever use the account's loss floor as the stop.
NoHedgingclassNo opposite positions on one instrument at once.
NoMartingaleclassNo sizing that doubles up after a loss.
NoNewsclassDo not hold trades through the news window around a release.
NoNewsBracketsclassNo pending orders placed around a news release.
NoOvernightclassNo trade open overnight.
NoWeekendHoldclassNo trade open over the weekend.
ON_BREACHconstant
PhaseclassOne phase of an evaluation: a profit target, with the days it needs.
PresetclassA named firm's rules from Forge's dated library, as ``prop = fg.prop.preset("ftmo-2step")``.
RequireStopclassEvery trade carries a stop.
RulesclassCustom prop-firm rules, as the class attribute ``prop = fg.prop.Rules(...)``.
ScalingclassA table of the lots the account may trade as its balance grows.
WARN_ATconstant
presetfunctionA named firm's rules from Forge's library, like ``fg.prop.preset("ftmo-2step", size=100_000)``.