From adcfb93f7df1596d7090b63bc9ae4ce26db33ea1 Mon Sep 17 00:00:00 2001 From: Rose Heart Date: Thu, 7 Nov 2024 17:24:51 +0000 Subject: [PATCH] Bug fix that removed orders before sell confirmation. Version update. Changes to be committed: modified: Base/JackrabbitLocker modified: Base/JackrabbitOliverTwist modified: Base/JackrabbitRelay modified: Base/Library/JRRmimic.py modified: Base/Library/JackrabbitProxy.py modified: Base/Library/JackrabbitRelay.py modified: Base/Library/OliverTwist-oanda.py --- Base/JackrabbitLocker | 2 +- Base/JackrabbitOliverTwist | 2 +- Base/JackrabbitRelay | 2 +- Base/Library/JRRmimic.py | 2 +- Base/Library/JackrabbitProxy.py | 2 +- Base/Library/JackrabbitRelay.py | 2 +- Base/Library/OliverTwist-oanda.py | 18 +++++++++++------- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Base/JackrabbitLocker b/Base/JackrabbitLocker index 11e13b0..17496fe 100755 --- a/Base/JackrabbitLocker +++ b/Base/JackrabbitLocker @@ -28,7 +28,7 @@ import json import JRRsupport -Version="0.0.0.1.1010" +Version="0.0.0.1.1015" BaseDirectory='/home/JackrabbitRelay2/Base' ConfigDirectory='/home/JackrabbitRelay2/Config' LogDirectory="/home/JackrabbitRelay2/Logs" diff --git a/Base/JackrabbitOliverTwist b/Base/JackrabbitOliverTwist index 37f5299..adcd3db 100755 --- a/Base/JackrabbitOliverTwist +++ b/Base/JackrabbitOliverTwist @@ -67,7 +67,7 @@ import subprocess import JRRsupport import JackrabbitRelay as JRR -Version="0.0.0.1.1010" +Version="0.0.0.1.1015" BaseDirectory='/home/JackrabbitRelay2/Base' DataDirectory='/home/JackrabbitRelay2/Data' ConfigDirectory='/home/JackrabbitRelay2/Config' diff --git a/Base/JackrabbitRelay b/Base/JackrabbitRelay index 4f8d5cc..b75f3af 100755 --- a/Base/JackrabbitRelay +++ b/Base/JackrabbitRelay @@ -16,7 +16,7 @@ import json import JRRsupport -Version="0.0.0.1.1010" +Version="0.0.0.1.1015" BaseDirectory='/home/JackrabbitRelay2/Base' ConfigDirectory='/home/JackrabbitRelay2/Config' LogDirectory="/home/JackrabbitRelay2/Logs" diff --git a/Base/Library/JRRmimic.py b/Base/Library/JRRmimic.py index 75d450f..9858324 100755 --- a/Base/Library/JRRmimic.py +++ b/Base/Library/JRRmimic.py @@ -48,7 +48,7 @@ class mimic: # released at exit. def __init__(self,Exchange,Config,Active,DataDirectory=None): - self.Version="0.0.0.1.1010" + self.Version="0.0.0.1.1015" self.StableCoinUSD=['USDT','USDC','BUSD','UST','DAI','FRAX','TUSD', \ 'USDP','LUSD','USDN','HUSD','FEI','TRIBE','RSR','OUSD','XSGD', \ diff --git a/Base/Library/JackrabbitProxy.py b/Base/Library/JackrabbitProxy.py index c16443f..2fdf9b2 100755 --- a/Base/Library/JackrabbitProxy.py +++ b/Base/Library/JackrabbitProxy.py @@ -50,7 +50,7 @@ class JackrabbitProxy: def __init__(self,framework=None,payload=None,exchange=None,account=None,asset=None,Usage=None): # All the default locations - self.Version="0.0.0.1.1010" + self.Version="0.0.0.1.1015" self.BaseDirectory='/home/JackrabbitRelay2/Base' self.ConfigDirectory='/home/JackrabbitRelay2/Config' self.DataDirectory="/home/JackrabbitRelay2/Data" diff --git a/Base/Library/JackrabbitRelay.py b/Base/Library/JackrabbitRelay.py index 2a1b5cc..4215c96 100755 --- a/Base/Library/JackrabbitRelay.py +++ b/Base/Library/JackrabbitRelay.py @@ -110,7 +110,7 @@ def Success(self,f,s): class JackrabbitRelay: def __init__(self,framework=None,payload=None,exchange=None,account=None,asset=None,secondary=None,NoIdentityVerification=False,Usage=None,RaiseError=False): # All the default locations - self.Version="0.0.0.1.1010" + self.Version="0.0.0.1.1015" self.NOhtml='NO!

NO!

' self.Directories={} self.Directories['Base']='/home/JackrabbitRelay2/Base' diff --git a/Base/Library/OliverTwist-oanda.py b/Base/Library/OliverTwist-oanda.py index 95d6d4c..ae20e70 100755 --- a/Base/Library/OliverTwist-oanda.py +++ b/Base/Library/OliverTwist-oanda.py @@ -364,15 +364,15 @@ def ProcessOrder(relay,Order,cid,units,price,strikePrice,ds,lowestOrder=None): # Write out the ledger entry relay.WriteLedger(Order=newOrder,Response=None) - return + return oid else: # Give OliverTwist a response relay.JRLog.Write(f"{id} -> {cid}: Order failed with {relay.GetFailedReason(result)}") - return + return None except Exception as e: # Something broke or went horrible wrong relay.JRLog.Write(f"CONDoanda {id}: {sys.exc_info()[-1].tb_lineno}/{str(e)}",stdOut=False) - return + return None # Make sure the trade exists on the broker. @@ -501,8 +501,10 @@ def CheckTakeProfit(relay,Orphan,lowestTrade): ds=datetime.datetime.strptime(dsS,'%Y-%m-%dT%H:%M:%S.%fZ') units=abs(float(orderDetail[-1]['units'])) - ProcessOrder(relay,Order,cid,units,price,strikePrice,ds,lowestOrder=lowestTrade) - return Orphan['Key'] + DeleteKey=ProcessOrder(relay,Order,cid,units,price,strikePrice,ds,lowestOrder=lowestTrade) + if DeleteKey: + return Orphan['Key'] + return None else: # Strike did not happen return None @@ -589,8 +591,10 @@ def CheckStopLoss(relay,Orphan,MarginStrike): ds=datetime.datetime.strptime(dsS,'%Y-%m-%dT%H:%M:%S.%fZ') units=abs(float(orderDetail[-1]['units'])) - ProcessOrder(relay,Order,cid,units,price,strikePrice,ds) - return Orphan['Key'] + DeleteKey=ProcessOrder(relay,Order,cid,units,price,strikePrice,ds) + if DeleteKey: + return Orphan['Key'] + return None else: # Strike did not happen return None