Closed kn0ll closed 2 years ago
also, what command do i use to figure out why all my stocks are tanking right now?
API is a must have for several reasons. I was also thinking about GraphQL.
also, what command do i use to figure out why all my stocks are tanking right now?
You would want to look at cyclical performance. I.e. compare stock performance March 2019 to March 2020 to March 2021.
Also compare the behavior of different industries at different stages of the business life cycle. Compare the behavior of growth stocks to value stocks. Stock market vs Bonds vs Commodities.
I will be adding portfolio analysis and modeling features.
What if we add a boolean flag to the methods like returnRaw and if its true, just return the responses?
This way, we can keep the same code, the same logic and just check for that on every method.
to be totally frank...your proposal would introduce new branches to every single one of those functions. if it was my library, i'd avoid those branches at all costs. if you let me tap in at a lower level, there is no branching for you to manage.
that said, that's definitely a personal "code quality" type metric. meaning, your proposal would definitely solve my problem and enable me to do what i want! so if you are comfortable with that, so am i. :)
one big benefit to your solution, which mine does not support, is that you could expose returnRaw
as an option from the command line as well, if you so pleased.
I think logic should be decoupled from presentation.
Decoupling logic from presentation will streamline testing too.
I started doing that https://github.com/DidierRLopes/GamestonkTerminal/blob/main/gamestonk_terminal/fundamental_analysis/market_watch_api.py#L191.
We need to formalize a convention.
The development going into this, is not fully harnessed unless it can be coupled to performing actual trades or provide an interface; whatever is be a locally hosted flask/django server with sqlite database or something more serious. Remember that the Bloomberg terminal isn't really a "terminal" - it is much more than that.
This would be epic. Any progress? Would love to hit this from a frontend.
Not yet, we are still adding features + refactoring code for the time being. Slowly and steady we'll get there :)
Dumping to file and possibly elastic would be a killer feature as well. Being able to run it programmatically and dump to file and ES would empower a lot of options.
@kn0ll we've done a big refactoring, I think the _model.py files pretty much have the behaviour you described here.
@DidierRLopes awesome! i notice in the behavior directory only contains _views
though, and code similar to when i submitted. is this just because they haven't been refactored yet? great work thanks!
@DidierRLopes awesome! i notice in the behavior directory only contains
_views
though, and code similar to when i submitted. is this just because they haven't been refactored yet? great work thanks!
Argghh was expecting you to not notice 😄 Yes, we're only missing behavioural analysis, government, and prediction technqiues I believe!
@DidierRLopes awesome! i notice in the behavior directory only contains
_views
though, and code similar to when i submitted. is this just because they haven't been refactored yet? great work thanks!
This one in particular should be done by this weekend
awesome, no worries! just wanted to make sure i understood what was going on. thank you all again.
This https://github.com/GamestonkTerminal/GamestonkTerminal/pull/1170 starts to address the issue
Closing this based on #1170 and subsequent work on this direction!
Looking forward to how you will make the most of our API :)
What's the problem of not having this feature? GamestonkTerminal has collected a ton of useful scripts and code, but it is all directly coupled to the command line program. it would be nice to have extensible ways to create other types of visualizations or clients.
Describe the solution you would like I think the simplest and most robust near term solution would be to:
fortunately, the well structured code means these types of changes are as minor as they can get. if we take
stocktwits_api.py
for example, you can see we never need to change code, only slightly reorganize it:this method could now still be used by the internal
messages()
andbullbear()
without more changes, but can also be consumed and reformatted by other programs.Describe alternatives you've considered currently i am just maintaining a separate fork where i am extracting all these methods out. the speed at which the project is moving suggests this is not a tenable solution though.
i could also try parsing the string based output of the program, but please don't make me.
Additional information when i say "publish the package" i say this because i was unable to include GamestonkTerminal as an external package, even when using a git remote. but Python is not my native home so maybe i was doing something wrong. in any case, even if this is oversight on my part, it would still require the data fetching methods to be abstracted out before it was super useful.
while this "feature" would be useful for any program, i am personally using it to create a GraphQL API so i can power any number of other clients:
if you think this is a viable suggestion, i'd be happy to contribute to a solution. and it would enable me to separately publish the GraphQL API i made. :)