diff --git a/core/forms.py b/core/forms.py index e22ed51..b77a42e 100644 --- a/core/forms.py +++ b/core/forms.py @@ -146,6 +146,7 @@ class StrategyForm(RestrictedFormMixin, ModelForm): "asset_group": "Asset groups determine which pairs can be traded.", "risk_model": "The risk model to use for this strategy. Highly recommended.", "trading_times": "When the strategy will place new trades.", + "order_settings": "Order settings to use for this strategy.", # "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.", "entry_signals": "Callbacks received to these signals will trigger a trade.", diff --git a/core/migrations/0068_strategy_order_settings.py b/core/migrations/0068_strategy_order_settings.py new file mode 100644 index 0000000..2590ca7 --- /dev/null +++ b/core/migrations/0068_strategy_order_settings.py @@ -0,0 +1,20 @@ +# Generated by Django 4.1.6 on 2023-02-15 18:34 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0067_ordersettings_strategy_order_settings'), + ] + + operations = [ + migrations.AddField( + model_name='strategy', + name='order_settings', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='core.ordersettings'), + preserve_default=False, + ), + ] diff --git a/core/models.py b/core/models.py index 32b5ace..38e2015 100644 --- a/core/models.py +++ b/core/models.py @@ -398,7 +398,8 @@ class Strategy(models.Model): "core.RiskModel", on_delete=models.PROTECT, null=True, blank=True ) order_settings = models.ForeignKey( - "core.OrderSettings", on_delete=models.PROTECT, null=True, blank=True + "core.OrderSettings", + on_delete=models.PROTECT, ) class Meta: