Interact with the UI
#5
Both the UI and the CLI version are aware of end(), since only backtests actually have any end date. If you run a backtest via the CLI you'll get a similar report at the end.

Yes, the difference is that one cannot post (or add) anything to the UI even though possible (performance analyzer does it).
Do note that end() is just an example and that the example is just an example of something one could do.

What does it mean for a strategy to end? Strategies don't have any end(), just other parts of the code in case a backtest is ran (that have to do a final report log or cleaning up DB handlers or so). But besides that, I'm really not sure what your example is supposed to do.. What if there is no browser connected? What if there are 10 browsers connected? What if this isn't run via any UI at all?


I means what you have written it means, from the docs:

// Optional for executing code
// after completion of a backtest.
// This block will not execute in
// live use as a live gekko is
// never ending.
strat.end = function() {
  // your code!
}

--

Interacting with the UI would be as useful/not useful as posting things to the terminal using log.debug()
or doing any other type of interaction. It's the same reason you opted to post results of the
Performance Analyzer to the UI? So basically as useful/not useful as that.

If there is no UI connected the output of the UI-performance analyzer wouldn't work either which currently is not a problem?
So i don't see the problem since there clearly is some condition that say UI true/false and does different things depending on that
just like you write.

if( this.ui ) alert('hello world'); // browser
else log.debug('hello world'); // terminal
  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: