Add order settings to strategy

This commit is contained in:
Mark Veidemanis 2023-02-15 18:35:46 +00:00
parent 660aca44db
commit 69cf8dcc10
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 23 additions and 1 deletions

View File

@ -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.",

View File

@ -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,
),
]

View File

@ -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: