Skip to content

Commit

Permalink
Bug fix in conditional order logging for OANDA.
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   Base/Library/CONDoanda.py
  • Loading branch information
rapmd73 committed Aug 6, 2024
1 parent d72ea6a commit 15b067a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Base/Library/CONDoanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,12 @@ def ReduceLotSize(relay,pair,val):

# Process a single order and log it. Handles bot profit and loss.

def ProcessOrder(relay,cid,price,strikePrice,ds):
def ProcessOrder(relay,cid,units,price,strikePrice,ds):
try:
# Get the action
saction=relay.Order['SellAction'].lower()
# Get the direction of the trade, long/short
dir=relay.Order['Direction'].lower()
units=relay.Order['Units']

# Build "strike" order. TakeProfit or StopLoss has been triggered
newOrder={}
Expand Down Expand Up @@ -345,7 +344,7 @@ def OrderProcessor(Orphan):
StrikeHappened=True

if StrikeHappened==True:
return ProcessOrder(relay,cid,price,strikePrice,ds)
return ProcessOrder(relay,cid,units,price,strikePrice,ds)
else:
# Strike did not happen
return 'Waiting'
Expand Down

0 comments on commit 15b067a

Please sign in to comment.