This repository has been archived by the owner on Feb 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Introduce Trade Class #1968
Merged
Merged
Introduce Trade Class #1968
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
964893e
subtract candle length from start time to calculate isPremature
chromadeployment 0cac468
Move startTimeMinusCandleSize inside realtime if check
ansonphong 1fe8aff
return the indicator after adding it
ansonphong 681bd04
Merge branch 'develop' of github.com:askmike/gekko into develop
ansonphong 2cc8b2a
Merge branch 'develop' of github.com:askmike/gekko into develop
ansonphong 55b3fe5
develop trade class
ansonphong 02c1d4d
make fixes after live market test
ansonphong 0568115
line spacing
ansonphong 6e8e8ed
rollback package-lock.json to develop branch
ansonphong 56a131c
link to discussion:
ansonphong 10f38be
move methods from portfolio manager into trade class and new portfoli…
ansonphong 180e745
cleanup logging, comments
ansonphong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to stick to OO: can you not pass the parent (portfolioManager) into the child (trade), these circular references are tightly coupled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's not ideal, let's fix this.
Currently there are multiple references to the manager inside the trade class, which would call for some restructuring. This is what we could do:
manager.exchange
manager.asset
andmanager.currency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently only needed for emitting events upstream, the trade class doesn't need it.
Some other functions won't be needed anymore by the portfolioManager, like setFee and setTicker (we will need this one later again, for the portfolioValueChange event for example). All the other functions will be used differently anyway, so I propose the portfolioManager passes the exchange (
this.exchange
) to the tradeclass which reimplements what it needs, we can also drop in the portfolioManager what we don't need. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@askmike OK that makes sense, yes let's keep a single Exchange instance, and move the methods into the Trade class. I'll make that happen, test it and update this PR.