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

Web frontend for Gekko #380

Closed
askmike opened this issue Jul 11, 2016 · 9 comments
Closed

Web frontend for Gekko #380

askmike opened this issue Jul 11, 2016 · 9 comments

Comments

@askmike
Copy link
Owner

askmike commented Jul 11, 2016

The previous webserver Gekko knew was implemented as a plugin, which I great if you want to monitor a running Gekko instance. But it cannot let you do anything besides that (changing a plugin, watch another market).

I am now working on a new web frontend that is able to run Gekko instances, see the web wrapper branch. When this is done this will be the only high level user interface. I am now working on setting up the basic stuff as well as adding the ability to run a backtest, demo:

gekko-web


This interface will basically be:

  • a list of running Gekko instances
    • click into them to see graphs for that market, etc.
  • easy forms to setup a new Gekko instance:
    • watch a new market and apply your trading method over it.
    • create an easy backtest (and apply your trading method over it).

I am very open to suggestions! You can test the new server by pulling in the web-wrapper branch and:

npm install
cd web
node server
@tongxiaofeng
Copy link

bash-3.2$ node server
module.js:442
throw err;
^

Error: Cannot find module '/Users/tongxiaofeng/Nutstore/Desktop/Code/gekko/server'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
bash-3.2$ cd web
bash-3.2$ node server
module.js:442
throw err;

Error: Cannot find module 'ws'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/tongxiaofeng/Nutstore/Desktop/Code/gekko/web/server.js:3:23)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

@tongxiaofeng
Copy link

missing dependency of 'ws', 'koa' and 'koa-static'.

@tongxiaofeng
Copy link

tongxiaofeng commented Jul 12, 2016

Mike, why don't use the vm (virtual machine module). Then you can assign the exchange, strategy, etc to the sandbox. Such each instance is running under a new context.

@askmike
Copy link
Owner Author

askmike commented Jul 12, 2016

missing dependency of 'ws', 'koa' and 'koa-static'.

fixed, thanks.

why don't use the vm (virturle machine module). Then you can assign the exchange, strategy, etc to the sandbox. Such each instance is running under a new context.

I am using Node child processes for the same purpose. I chose this over using vms for the following reasons:

  • The IPC channel provided by child_process.fork probably has better performances. Right now only log information is passed from child to the "parent" (webserver ctx), but this will be extended to the complete market stream soon (needs to be performant for backtesting).
  • I am using a very handy module that implements childprocess.fork under the hood.
  • Right now when Gekko encounters a problem it will take down the whole process, I can just leave that behaviour if I go run the complete code in a child process.

@hoddy
Copy link
Contributor

hoddy commented Jul 13, 2016

I think this sounds great, I look forward to seeing it up and running. I think any way to show data graphically is going to improve testing of trading strategy's and running multiple instances has got to be a plus.

At the moment i use an Android App called TabTrader to Visualize what Gekko is doing, I have to input the data points for my strategy and then it shows from my API when Gekko traded so from that I can see if everything is working to plan, would be great if we could see some sort of graphic I'm assuming showing the strategy's would be quite complex but trade points would be good!

@jreinstra
Copy link

jreinstra commented Sep 8, 2016

I'm not sure how useful this would be but I recently open-sourced Acacia Trading's server + web interface code, which you can see here: https://github.com/AcaciaTrading/acacia_main

The backend is written in Python/Django but some of the frontend stuff might be useful for gekko.

@BarnumD
Copy link
Contributor

BarnumD commented Jan 9, 2017

Can this be used with custom methods? I see mine in the list, but when I try to run a backtest from the web ui nothing happens. From the process on the command line I get:

<-- POST /api/backtest
  xxx POST /api/backtest 500 164ms -

  Error: non-error thrown: Child process has died.
      at Object.module.exports.onerror (/usr/src/gekko/node_modules/koa/lib/context.js:107:40)
      at process._tickCallback (internal/process/next_tick.js:103:7)

@freshpatze
Copy link

+1 backtesting of custom method unfortunately does not work via UI. I get the same exception: Child process has died

@askmike askmike mentioned this issue Mar 4, 2017
@askmike
Copy link
Owner Author

askmike commented Mar 4, 2017

closed in favor of #489.

@askmike askmike closed this as completed Mar 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants