Superalgos / Superalgos

Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.
https://www.superalgos.org
Apache License 2.0
4.11k stars 5.52k forks source link

Improve the UI responsive when switching workspace #311

Closed anvd closed 3 years ago

anvd commented 3 years ago

Context

I have problem when switching workspaces in Superalgos. The context is that on the develop branch, after finishing the tutorial series on “Trading System Design Tutorials” workspace, I have switched to “Weak-hands Buster V2 plug-in” workspace. The Chrome UI is not responsive

Operating System: Frontend runs on MacOs, Backend runs on Ubuntu.

Software version: Develop branch, commit a3c07edc9

Workspace version: “Trading System Design Tutorials” and “Weak-hands Buster V2”

Reproducible: the issue may be reproduced.

Explain your issue

1. Explain what the problem seems to be.

I guess that after running through the tutorial series, the “Trading System Design Tutorials” workspace has been filled with a lot of data. It may thus take more time to switch workspaces. It would be useful if Superalgos can inform this information on the UI (e.g., using some kinds of progressive UI/UX) so that the user knows that the switch workspace process is running in the backend.

2. Clearly explain what you wish to accomplish.

I can switch workspaces successfully.

3. Explain, step by step, what you've done to achieve the goal. The Team will follow these steps to reproduce the issue, so be precise.

  1. Finish the tutorials in the “Trading System Design Tutorials” workspace.
  2. Switch to "Weak-hands Buster V2" workspace.

4. Explain what is the result you expect from your actions.

The workspace is successfully switched and the tutorial is displayed.

5. Explain what happens instead of the expected results.

Chrome is not responsive. switch_failed

Restart Superalgos, the workspace seems have been broken. Screen Shot 2020-12-27 at 1 30 18 PM

However, on a Superalgos fresh installation, I can switch to "Weak-hands Buster V2" in the first launch. fresh_workspace

cozed-gh commented 3 years ago

Havn't got a better explanation rather than that I experience the same as above. Backend: Raspberry Pi (raspian, 4gb ram, running minMemo noBrowser) Frontend: Windows 10, Chrome Problem: Same as above - Once in a while I get to a point where the page freezes or "something" happens where i need to reload the workspace, and the project disappears/ GUI gets broken (exactly as above picture). I can reload any other plugin, and get back to the "normal" GUI, but when I try to reload the autosaved workspace from "My-Workspaces", it is still "broken".

anvd commented 3 years ago

That's right I can reload the original plugin workspace. But the workspace copied to "My-Workspaces" seems to be broken.

Luis-Fernando-Molina commented 3 years ago

Can you please switch to the develop branch and use the system there? There are some fixes there to that problem that i would like to know if they work for you. Currently I am not reproducing that behavior, but I am at the develop branch. If it still happens to you in develop again, please let me know.

cozed-gh commented 3 years ago

(havn't looked into switching into dev branch yet) Shooting from the hip here - But I get the feeling that it has some problems saving changes (might be related to privleges) I got "There was a problem saving..." in the bar between design and charting space. Tried to copy an existing, functioning workspace within "My-Workspaces" as my user - but I couldn't 'cp' it without 'sudo'. So I figured I might try to start Superalgos with 'sudo' in order to allow the session to write data into the Superalgos folder. Didn't make any difference. Also started Superalgos as 'root' - but I'm still missing some changes I made yesterday. (I know it's a rule of thumb never to be logged in as root consistently) Yesterday I was quite hammering Ctrl+Shift+S to make sure it said "Saved" (which it did). Is there any log where I can see these "Problem saving" errors - So we get some more info.

Just posting an example for this: image

Today when I was trying to load my edited workspaces from yesterday it seems to have loaded the "original" into my somewhat edited workspace. Yesterday I detached "Xtreme" from the Trading System - and as you can see in the picture, it's still there and it's still detached. But there's also a "new" one that looks like the original from WHBv2, attached to the Trading System. I also reworked the whole section of stages, but that didn't get saved. Everything was relating to the Zeus Data Mine, which I added yesterday, which got saved and is still there. Conclusion - Some things get saved, some not.

julian-molina commented 3 years ago

"Conclusion - Some things get saved, some not."

About that note, that is actually true and to be expected. This is the thing: data structures that are included in the workspace as plugins may not be modified and saved at the workspace level.

To modify a data structure it must be part of the workspace (dragged and dropped into the workspace).

Take a look at this part of the docs: https://docs.superalgos.org/suite-hierarchy-plugins.html#plugins

I don't know if that may be part of your issue or not. It depends on what you've done with your workspace and what structures it is you are trying to modify and save.

cozed-gh commented 3 years ago

Well, I did manage to drag and drop Zeus into the workspace - and it's still there today. After I added Zeus, I managed to build my stategy with it - Detaching 'Xtreme', and just edited the other one to my needs, using Zeus (DMI in this case). Zeus Data Mine is still there, but all Strategy work is lost.

This is in a workspace that's in "My-Workspaces" - saved from a plugin (wanted something to build from) - so I get the picture faster. :)

julian-molina commented 3 years ago

That would be consistent with the expected behavior provided that the trading system you were working on is included as a plugin. If that is the case, to avoid loosing further work you must:

  1. Clone the trading system.
  2. Remove the Plugin File reference (so that the trading system is not included again every time you reload the page).
  3. Delete the included trading system.
  4. Restore the clone on the workspace (drag and drop the cloned file on the design space).
  5. Work on the cloned data structure, which is now part of the workspace.

Either way, this doesn't seem to be related to the issue reported in the OP. If you have any further difficulties with this, drop by the Telegram Support Group so that we can work it out.

cozed-gh commented 3 years ago

Brilliant Julian! You're right - this might be off topic. However I didn't get that OP issue when starting the session as root yesterday, the day before that I got it several times (3-4 times during a 5h "trying to figure things out"-session).

julian-molina commented 3 years ago

Regarding permissions, if you place the Superalgos folder in a location where the logged-on user has write permissions, you shouldn't need to run as admin or root.

Luis-Fernando-Molina commented 3 years ago

What I can add here is that there was a bug that was difficult to chase because it did not happen often and was difficult to reproduce, that saved the workspace with almost an empty file. That is the one that might have been solved in develop. Based on all the difficulties I see, I will probably take some time and make some changes to the workspace managment:

  1. I want to stop calling Plugin Workspaces and replace those for Template workspaces, because they do not behave like all the other plugins.
  2. I would make the automatic saving to writhe the file with a different name than when you save it with CTRL + S, like adding -backup to the name for instance.
  3. Probably I go as far as changing the UI of the Workspaces Tab, since it is confusing to have both 'plugins' and 'my workspaces' together. Hope after a few days spent there all this will behave better. :-)
Luis-Fernando-Molina commented 3 years ago
  1. Making the UI more responsive while switching workspaces.
anvd commented 3 years ago

Here is how I reproduce the behaviour. Environment: Backend runs on Ubuntu 20.04. Access the backend using Chrome running on MacOS. I’m on develop branch, commit f24796c32

Steps:

  1. SSH to the Ubuntu machine and launch Superalgos with “node run noBrowser”
  2. Access Superalgos from MacOS, change the ip address in the Network Node to point to the Ubuntu machine.
  3. Switch to “Plugin -> Weak-Hands-Buster v2” workspace, change the ip address in the Network Node to point to the Ubuntu machine.
  4. Close Chrome
  5. Open Chrome and access SuperAlgos. The workspace is showed with only one “Weak-hands Buster v2” icon. All other icons disappear. Of course, I can reload the “Plugin -> Weak-Hands-Buster v2” workspace to make everything work again. Screen Shot 2020-12-31 at 5 25 54 AM
anvd commented 3 years ago

I would love to test these changes as soon as they are available :-)

Luis-Fernando-Molina commented 3 years ago

Ok, I managed to work on the UI responsiveness while switching workspaces. I think that now is responsive enough, if not, let me know. I will close this issue for now, and open 3 others related to other tasks I said I would do some day.

Changes are available at the develop branch.

I want to stop calling Plugin Workspaces and replace those for Template workspaces, because they do not behave like all the other plugins. I would make the automatic saving to writhe the file with a different name than when you save it with CTRL + S, like adding -backup to the name for instance. Probably I go as far as changing the UI of the Workspaces Tab, since it is confusing to have both 'plugins' and 'my workspaces' together. Hope after a few days spent there all this will behave better. :-)