Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Added ability to execute shell commands on advice #100

Closed
wants to merge 6 commits into from
Closed

Added ability to execute shell commands on advice #100

wants to merge 6 commits into from

Conversation

zerodivide1
Copy link

Added simple framework to execute arbitrary command-line commands on any new advice. This can allow for arbitrary functionality to be 'plugged-into' Gekko without having to code it into the application.

For example, this can be used to invoke a notification service like Pushbullet so that advice can be delivered as push messages to Android devices instead of through mail. This can also be used to replace the built-in mail framework so that Google accounts are not necessary to send emails.

@askmike
Copy link
Owner

askmike commented Dec 30, 2013

Thanks for your addition. It would be handy if you could add a sample usage (to the docs for example) for example how to use this in combination with pushbullet.

Right now I am rewriting the whole of Gekko's core which means all internal APIs are going to change and this will probably break. (Unfortunately it is not yet clear how the internal API design will look like).

Last thing: I totally think everyone should be credited for their work and I really don't like that my donation address is the only one there right now while others are contributing as well. But adding 20 lines of code and adding your donation address to the README is not fair for all the people who contributed more than that.

To get an idea of contributions by everyone, take a look at the commit history of the dev branch.

So at this moment I will not merge this in.

@zerodivide1
Copy link
Author

Mike,
I understand and will reauthor my changes when I have a chance to dis-include my inclusion on the README. I will also provide some information about using Pushbullet for advice notifications. I tried to avoid making any specific mention of 3rd party products in the code itself so that users will understand that no specific product or service is being endorsed - it was just a use-case to illustrate what I was attempting to do.

As for the internal API changes, I took a brief look and it should be trivial to add my changes to the localDB branch code. I will switch to that branch and submit the changes when I make my changes.

@askmike
Copy link
Owner

askmike commented Dec 30, 2013

Awesome thanks!

I do agree that there should be an explanation in the README that explains the functionality without hooking it up to any specific third party. But right now I really don't know where to begin if I want to plug it into something like pushbullet.

And about the localDB branch: the advice information was being routed straight from a consulter (trading method) into everything interested inside gekko.js. Though that code is still the same (because I only started working on the databaseManager, candleManager and tradeFetcher) this code is going to change a lot: every piece of code that wants to do something with a certain advice is going to need to register as an Actor. Also the format in which advice flows (like the meta string) is going to change.

@askmike
Copy link
Owner

askmike commented Dec 31, 2013

@zerodivide1 I have implemented the draft system I was talking about. It's stable enough that if the API changes, I will update the actors myself.

Here you can see an implementation which logs to stdout and here you can see what is being expected of only advice actors.

So basically you only have to create an object with the method processAdvice that handles with the advice. The logger I referred to is a little bigger because it also keeps track of market state (latest price & latest trade date), this way it is also an market actor with the methods init and processCandle.

@zerodivide1
Copy link
Author

Thanks, I'll take a look at it.

What are the options for the "advice" argument? Am I correct in assuming that "short" and "long" are the new options instead of "BUY" and "SELL"?

@askmike
Copy link
Owner

askmike commented Jan 1, 2014

Yes, short = sell & long = buy. The parameter of portfolio is to indicate how much of the portfolio should take this positition (always 1.0 or 100% now).

@askmike
Copy link
Owner

askmike commented Jan 1, 2014

I did change it a little, now you can read all the information you need in the doc!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants