Skip to content

Commit

Permalink
Bug fix that removed orders before sell confirmation.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rapmd73 committed Nov 7, 2024
1 parent 516b255 commit adcfb93
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Base/JackrabbitLocker
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Base/JackrabbitOliverTwist
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion Base/JackrabbitRelay
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Base/Library/JRRmimic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', \
Expand Down
2 changes: 1 addition & 1 deletion Base/Library/JackrabbitProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Base/Library/JackrabbitRelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='<html><title>NO!</title><body style="background-color:#ffff00;display:flex;weight:100vw;height:100vh;align-items:center;justify-content:center"><h1 style="color:#ff0000;font-weight:1000;font-size:10rem">NO!</h1></body></html>'
self.Directories={}
self.Directories['Base']='/home/JackrabbitRelay2/Base'
Expand Down
18 changes: 11 additions & 7 deletions Base/Library/OliverTwist-oanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit adcfb93

Please sign in to comment.