amor71 / LiuAlgoTrader

Framework for algorithmic trading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to start LiuAlgoTrader in Firefox

ksilo opened this issue · comments

commented

Describe the bug
Unable to start LiuAlgoTrader in Firefox on Linux Debian

To Reproduce
Installation tutorial was followed exactly and all prerequisites were met

Screenshots
Screenshot from 2021-09-24 07-35-13

Desktop (please complete the following information):

  • Linux Debian 10
  • Firefox ESR
  • 78.14.0esr (64-bit)

Thank you for joining LiuAlgoTrader community and submitting your first issue. Feel free to check out Liu community: https://gitter.im/LiuAlgoTrader/community

@ksilo It looks like DB connection failed:

  1. Is your Docker engine working, and running the PostgreSQL?
  2. Are you able to connect to the DB?
commented

@amor71 everything seems up and running

Screenshot from 2021-09-24 14-08-38
g

commented

Yes, I can connect using \psql -h localhost -p 5400 -U liu

@ksilo The error shows:

image

The installation wizard should have created a file env_vars.sh and you're supposed to run it before running streamlit. The file should be something like this:

export DSN=postgresql://liu:liu@localhost:5400/liu

That should direct the DB session creation to port 5400 and not 5432 -> Are you 100% sure you executed the script prior? Does it look like the above?

Can you take a screenshot of the DSN prior to running stteamlit

commented

@amor71 I think what's happening is: installation wizard can't access
https://raw.githubusercontent.com/amor71/LiuAlgoTrader/master/examples/quickstart/

probablly that's why env_vars.sh scrip isn't created

running it manually did the job: export DSN=postgresql://liu:liu@localhost:5400/liu

@ksilo The liu application creates the file, I'm not sure what you mean by can't access it?

            with open(f"{samples_location}env_vars.sh", "w") as f:
                f.write(
                    f"export DSN=postgresql://{user}:{passwd}@localhost:5400/{db}\n"
                )

Was the file not created for you, in the subfolder? Can you please confirm that and I'll look further?

commented

sample files were not created in the sub folder, files = ["tradeplan.toml", "vwap_short.py", "momentum_long_simplified.py"], env_vars.sh scrip was not created also

I've checked liu.py source code and found out that link is not working in def setup_samples (400: Invalid request) for downloading sample files, could it be that due to this reason code for creating env_vars.sh was not executed? <-- I already figured out that this is wrong

but nor the samples nor the .sh script were created in the sub folder after installation wizard was completed

commented

I don't have liu_samples folder (that's the problem), just liu_data

Screenshot from 2021-09-25 17-00-29

@ksilo I just restarted from scratch, and I do see the files. Can u please try to re-run the liu quickstart and confirm you selected to create the samples. Pls see the below screenshots, LMK if you had any errors in that process, maybe something prevented the download or file creation for some reason. Thank you for checking.

image

After DB installation you should see this:

image

image

commented

nope, setting up samples step not start
Screenshot from 2021-09-25 19-28-24
Screenshot from 2021-09-25 19-31-58
Screenshot from 2021-09-25 19-32-16

commented

yep, as you see, I don't get prompt for selecting location for sample files

@ksilo Thanks for sharing the full details. I found the issue and pushed a fix. Version 0.3.27 has just been published.

The issue was that you entered "Y" instead of pressing the enter key...

This line failed:
samples = not len(i) or i.lower in ("y", "yes")
it should be:
samples = not len(i) or i.lower() in ("y", "yes")

Can you please pull the latest (0.3.27) and confirm the fix and close the issue?

Thanks much for noticing, well done!

commented

yes! everything is working now!