Compare commits

..

2 Commits

Author SHA1 Message Date
e8a2f9b0fa
Update strategy defaults 2022-11-06 07:20:24 +00:00
6dd2997a74
Fix posting trades 2022-11-06 07:20:32 +00:00
3 changed files with 4 additions and 4 deletions

View File

@ -97,7 +97,7 @@ def execute_strategy(callback, strategy):
direction=direction,
)
new_trade.save()
posted, info = new_trade.post()
info = new_trade.post()
log.debug(f"Posted trade: {posted} - {info}")

View File

@ -30,7 +30,7 @@ GetAllAssetsSchema = {
[
{
"id": "id",
"class": "class",
"class": "class_",
"exchange": "exchange",
"symbol": "symbol",
"name": "name",

View File

@ -204,10 +204,10 @@ class Strategy(models.Model):
account = models.ForeignKey(Account, on_delete=models.CASCADE)
hooks = models.ManyToManyField(Hook)
enabled = models.BooleanField(default=False)
take_profit_percent = models.FloatField(default=3.0)
take_profit_percent = models.FloatField(default=1.5)
stop_loss_percent = models.FloatField(default=1.0)
price_slippage_percent = models.FloatField(default=2.5)
trade_size_percent = models.FloatField(default=2.5)
trade_size_percent = models.FloatField(default=0.5)
def __str__(self):
return self.name