Interact with the UI
#6
> I means what you have written it means, from the docs:
>
> strat.end = function() {
> // your code!
> }

Damn, not sure if these docs are stil up to date. You could easily verify this by logging something there and running a backtest. If they are right you just outsmarted me on what Gekko can do Wink

-------

I think I get the point of what you are trying to do, and I am definitely working on a big upgrade which will enable all of this (just in a different way). Have a look at this PR: https://github.com/askmike/gekko/pull/1850

Specifically have a look at this (work in progress) new documentation file: https://github.com/askmike/gekko/blob/7c.../events.md

When I am done I will add a custom event your strat can emit, and any other plugin can listen to it (these events will also be sent to the browser, but not as hidden as the performanceAnalyzer currently does it). The next step would be a way to hook into this event in the UI and run whatever code you want. There are a two ways I am thinking about:

- introduce a new type of plugins ("UI plugins")
- extend the current plugin type to have "UI handles" that are actually run in the UI <- this one is probably best in the long run: this way a plugin can "register" JS to be run in the UI, enabling custom widgets and such.

It's important to note that I do NOT want your strat to have code that will be run in the UI automatically, for a number of reasons:

- There might not be an UI, or the UI might not be running when the event happens.
- There might be multiple UIs running looking at the same strat.
- It's a big security risk, strats now have the opportunity to run a browser context (of a potentially different machine).
- Some people are working on a native mobile Gekko App, these might not be able to execute client side javascript (or if they can it's another security risk).
  Reply


Messages In This Thread
Interact with the UI - by tommiehansen - 02-06-2018, 06:25 PM
RE: Interact with the UI - by askmike - 02-07-2018, 04:04 AM
RE: Interact with the UI - by tommiehansen - 02-07-2018, 10:02 AM
RE: Interact with the UI - by askmike - 02-07-2018, 11:16 AM
RE: Interact with the UI - by tommiehansen - 02-07-2018, 10:26 PM
RE: Interact with the UI - by askmike - 02-08-2018, 04:28 AM
RE: Interact with the UI - by tommiehansen - 02-09-2018, 12:43 PM

Forum Jump:


Users browsing this thread: