From 617b485a0147266d93ec7db22afd2cd9055b0c09 Mon Sep 17 00:00:00 2001 From: lxf Date: Mon, 3 Jan 2022 17:02:50 -0500 Subject: trad: new options tracker that works better for WON system --- .../0017_luxoptioncontact_luxoptionpurchase.py | 34 ++++++++++++++++++++++ .../migrations/0018_luxoptionpurchase_pl.py | 18 ++++++++++++ app/trading/migrations/0019_auto_20220103_1458.py | 32 ++++++++++++++++++++ app/trading/migrations/0020_auto_20220103_1517.py | 23 +++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 app/trading/migrations/0017_luxoptioncontact_luxoptionpurchase.py create mode 100644 app/trading/migrations/0018_luxoptionpurchase_pl.py create mode 100644 app/trading/migrations/0019_auto_20220103_1458.py create mode 100644 app/trading/migrations/0020_auto_20220103_1517.py (limited to 'app/trading/migrations') diff --git a/app/trading/migrations/0017_luxoptioncontact_luxoptionpurchase.py b/app/trading/migrations/0017_luxoptioncontact_luxoptionpurchase.py new file mode 100644 index 0000000..2258466 --- /dev/null +++ b/app/trading/migrations/0017_luxoptioncontact_luxoptionpurchase.py @@ -0,0 +1,34 @@ +# Generated by Django 3.2.7 on 2022-01-03 13:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('trading', '0016_alter_luxoptionstrade_pl'), + ] + + operations = [ + migrations.CreateModel( + name='LuxOptionContact', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('symbol', models.CharField(max_length=256)), + ('strike_price', models.FloatField()), + ('expiration_date', models.DateField()), + ('contract_open_price', models.FloatField()), + ('contract_close_price', models.FloatField(blank=True, null=True)), + ('call_put', models.IntegerField(choices=[(0, 'Call'), (1, 'Put')], default=0)), + ], + ), + migrations.CreateModel( + name='LuxOptionPurchase', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('symbol', models.CharField(max_length=256)), + ('open_date', models.DateTimeField(auto_now_add=True)), + ('contracts', models.ManyToManyField(to='trading.LuxOptionContact')), + ], + ), + ] diff --git a/app/trading/migrations/0018_luxoptionpurchase_pl.py b/app/trading/migrations/0018_luxoptionpurchase_pl.py new file mode 100644 index 0000000..46d3b66 --- /dev/null +++ b/app/trading/migrations/0018_luxoptionpurchase_pl.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.7 on 2022-01-03 14:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('trading', '0017_luxoptioncontact_luxoptionpurchase'), + ] + + operations = [ + migrations.AddField( + model_name='luxoptionpurchase', + name='pl', + field=models.FloatField(blank=True, null=True), + ), + ] diff --git a/app/trading/migrations/0019_auto_20220103_1458.py b/app/trading/migrations/0019_auto_20220103_1458.py new file mode 100644 index 0000000..d0d6529 --- /dev/null +++ b/app/trading/migrations/0019_auto_20220103_1458.py @@ -0,0 +1,32 @@ +# Generated by Django 3.2.7 on 2022-01-03 14:58 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('trading', '0018_luxoptionpurchase_pl'), + ] + + operations = [ + migrations.AlterModelOptions( + name='luxoptionpurchase', + options={'get_latest_by': 'open_date', 'ordering': ('-open_date',)}, + ), + migrations.RemoveField( + model_name='luxoptionpurchase', + name='contracts', + ), + migrations.AddField( + model_name='luxoptioncontact', + name='options_purchase', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='trading.luxoptionpurchase'), + ), + migrations.AlterField( + model_name='luxoptioncontact', + name='call_put', + field=models.IntegerField(choices=[(0, 'C'), (1, 'P')], default=0), + ), + ] diff --git a/app/trading/migrations/0020_auto_20220103_1517.py b/app/trading/migrations/0020_auto_20220103_1517.py new file mode 100644 index 0000000..73c4b5f --- /dev/null +++ b/app/trading/migrations/0020_auto_20220103_1517.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.7 on 2022-01-03 15:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('trading', '0019_auto_20220103_1458'), + ] + + operations = [ + migrations.AddField( + model_name='luxoptionpurchase', + name='close_date', + field=models.DateTimeField(null=True), + ), + migrations.AddField( + model_name='luxoptionpurchase', + name='status', + field=models.IntegerField(choices=[(0, 'Open'), (1, 'Closed')], default=1), + ), + ] -- cgit v1.2.3-70-g09d2