# Check it's not something like a CharField which has no queryset
ifnothasattr(self.fields[field],"queryset"):
@ -69,6 +70,11 @@ class HookForm(RestrictedFormMixin, ModelForm):
"hook",
"direction",
)
help_texts={
"name":"Name of the hook. Informational only.",
"hook":"The URL slug to use for the hook. Make it unique.",
"direction":"The direction of the hook. This is used to determine if the hook is a buy or sell.",
}
# All string/multiple choice fields
@ -82,6 +88,13 @@ class AccountForm(RestrictedFormMixin, ModelForm):
"api_secret",
"sandbox",
)
help_texts={
"name":"Name of the account. Informational only.",
"exchange":"The exchange to use for this account.",
"api_key":"The API key or username for the account.",
"api_secret":"The API secret or password/token for the account.",
"sandbox":"Whether to use the sandbox/demo or not.",
}
# Restricted mixin for account and hooks
@ -105,6 +118,23 @@ class StrategyForm(RestrictedFormMixin, ModelForm):
"trade_size_percent",
)
help_texts={
"name":"Name of the strategy. Informational only.",
"description":"Description of the strategy. Informational only.",
"account":"The account to use for this strategy.",
"trading_times":"When the strategy will place new trades.",
"order_type":"Market: Buy/Sell at the current market price. Limit: Buy/Sell at a specified price. Limits protect you more against market slippage.",
"time_in_force":"The time in force controls how the order is executed.",
"hooks":"The hooks to attach to this strategy. Callbacks received to these hooks will trigger a trade.",
"enabled":"Whether the strategy is enabled.",
"take_profit_percent":"The take profit will be set at this percentage above/below the entry price.",
"stop_loss_percent":"The stop loss will be set at this percentage above/below the entry price.",
"trailing_stop_loss_percent":"The trailing stop loss will be set at this percentage above/below the entry price. A trailing stop loss will follow the price as it moves in your favor.",
"price_slippage_percent":"The price slippage is the maximum percent the price can move against you before the trade is cancelled. Limit orders will be set at this percentage against your favour. Market orders will have a price bound set if this is supported.",
"callback_price_deviation_percent":"The callback price deviation is the maximum percent the price can change between receiving the callback and acting on it. This protects against rogue or delayed callbacks. Keep it low.",
"trade_size_percent":"Percentage of the account balance to use for each trade.",