Skip to content

Commit

Permalink
Bug fixes and optimizations.
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   Base/Library/JRRoanda.py
	modified:   Extras/AnalyzeAsset
  • Loading branch information
rapmd73 committed Dec 11, 2023
1 parent c103548 commit 2b970e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Base/Library/JRRoanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ def GetOrderDetails(self,**kwargs):

# Check for a "chain" sequence order and find the beginning

# These elements occur WITH orderID

# 'tradeReduced' if we reduce a trade size
# 'tradeClose' if we close a trade altogether

# if 'tradeClose' in self.Results['transaction']:
# nid=int(self.Results['transaction']['tradeClose']['tradeID'])
# if nid<int(ticket):
# FinalResults.append(self.GetOrderDetails(OrderID=str(nid)))

if 'replacesOrderID' in self.Results['transaction']:
nid=int(self.Results['transaction']['replacesOrderID'])
if nid<int(ticket):
Expand All @@ -471,6 +481,8 @@ def GetOrderDetails(self,**kwargs):

FinalResults.append(self.Results['transaction'])

# return FinalResults

tid=int(self.Results['transaction']['id'])
ltid=int(self.Results['lastTransactionID'])

Expand Down
5 changes: 3 additions & 2 deletions Extras/AnalyzeAsset
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ print()
mmm=maxMonth[2]-maxMonth[3] # Maximum monthly movement
amm=sum(spList)/len(spList) # Average monthly movement

print(f"Maximum month movement: {round(mmm,percision):.{percision}f} ({(mmm/mh)*100:.2f}%)")
print(f"Average month movement: {round(amm,percision):.{percision}f} ({(amm/mh)*100:.2f}%)")
print(f"Maximum {relay.Timeframes[-1]} movement: {round(mmm,percision):.{percision}f} ({(mmm/mh)*100:.2f}%)")
print(f"Average {relay.Timeframes[-1]} movement: {round(amm,percision):.{percision}f} ({(amm/mh)*100:.2f}%)")

print()

Expand All @@ -111,3 +111,4 @@ for slice in spList:
lsp=len(spList)
print(f"Total {relay.Timeframes[-1]}s analyzed: {lsp}")
print(f"{relay.Timeframes[-1]}s above average: {maa} ({(maa/lsp)*100:.2f}%)")

0 comments on commit 2b970e1

Please sign in to comment.