Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 24 17:27

    amor71 on scheduled-update-2022-01-24

    (compare)

  • Jan 24 17:27

    amor71 on master

    Update pytest-asyncio from 0.17… Update sphinx-autodoc-typehints… Update pre-commit from 2.16.0 t… and 10 more (compare)

  • Jan 24 17:27
    amor71 closed #297
  • Jan 24 17:26

    amor71 on master

    first commit (1) rename var in run_polygon (… alpaca API WIP and 14 more (compare)

  • Jan 24 17:26
    amor71 closed #278
  • Jan 24 16:52
    riven314 commented #278
  • Jan 24 16:51
    sourcery-ai[bot] commented #278
  • Jan 24 16:51
    sourcery-ai[bot] commented #278
  • Jan 24 16:51
    riven314 synchronize #278
  • Jan 24 16:51

    riven314 on add-alpaca-to-momentum-scanner

    fix test (compare)

  • Jan 24 16:50
    sourcery-ai[bot] commented #278
  • Jan 24 16:50
    sourcery-ai[bot] commented #278
  • Jan 24 16:50
    riven314 synchronize #278
  • Jan 24 16:41

    sourcery-ai[bot] on al

    (compare)

  • Jan 24 16:41
    sourcery-ai[bot] closed #298
  • Jan 24 16:40
    sourcery-ai[bot] commented #278
  • Jan 24 16:40
    sourcery-ai[bot] commented #278
  • Jan 24 16:40
    riven314 synchronize #278
  • Jan 24 16:40

    riven314 on add-alpaca-to-momentum-scanner

    (compare)

  • Jan 24 16:29
    sourcery-ai[bot] commented #298
Elliot V Pourmand
@ElliotVilhelm
Hi @amor71 , I am on the latest version of liu, I have tried set up on my mac and windows, in both cases I have successfully launched the app but I do not see the same options in the documentation. Notice there is no back-test a specific day, and I am unable to pull data from alpaca.
In your docs I see you have "back-test against the whole day" and a "Select Environment" drop down.
In neither setups did I see these options available, I have not been able to download any data.
Elliot V Pourmand
@ElliotVilhelm
@amor71
@amor71
@ElliotVilhelm thanks for reaching out. To view the sample data in your DB you should choose the analyzer.
Generally speaking, I'm gradually stepping away from streamlit and focusing on the Jupyter Notebooks. The reason is that streamlit was slow to adopt to 3.9 and I don't have the capacity to support both notebooks and streamlit, the community seems to prefer the notebooks anyhow.
It is still there, mostly to do end-to-end tests post-installation and see something visual.
if you want to backtest you should use the command-line tools. If you need instructions lmk. If you're having difficulties with it, we can do an online 1:1 session and I'll show you how to use it.
@ElliotVilhelm .
Elliot V Pourmand
@ElliotVilhelm
Awesome, thank you for being responsive. I had transitioned into working off the CLI tool as well. I just seem to have some trouble understanding how to get the backtester to pull data for a historical trade day. I would be very happy to pair with you as soon as you have some time. I am very excited over this project and hope to become a contributor in due time. @amor71
Elliot V Pourmand
@ElliotVilhelm

Based off these points in the docs

When the backtester application starts, it lists all the stocks picked by the scanners during the trading session. backtester re-runs each session, by loading per-minute candles for the stock trading session (up to one week back).

I am a bit confused on how to load intraday historical data for a session I did not trade. I did read a note on using the miners in the documentation as well but it seems as though this type of loading must be supported in some way? Essentially I am looking to backtest on a prior trade day for which I have no data for, no prior batch-id. Likely I am misunderstanding something here.

@amor71
@amor71
pushed version 0.3.20 -> includes fixes due to Alapca recent API changes.
@ElliotVilhelm I'll DM you
Joel Brass
@jbrass
@amor71 This project looks very cool. I have installed it with my PG connection string and alpaca credentials in the env file. This all seems to be working. I am not sure how to get any data into the system. When I run the market_miner I get the following error:
Traceback (most recent call last):
File "/root/miniconda3/envs/liua/bin/market_miner", line 101, in <module>
asyncio.run(main(conf_dict))
File "/root/miniconda3/envs/liua/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/miniconda3/envs/liua/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/root/miniconda3/envs/liua/bin/market_miner", line 36, in main
await asyncio.gather(task_list)
File "/root/miniconda3/envs/liua/lib/python3.9/site-packages/liualgotrader/common/decorators.py", line 18, in helper
result = await process(func,
args, params)
File "/root/miniconda3/envs/liua/lib/python3.9/site-packages/liualgotrader/common/decorators.py", line 11, in process
return await func(*args,
params)
File "/root/miniconda3/envs/liua/lib/python3.9/site-packages/liualgotrader/miners/stock_cluster.py", line 38, in run
count = self._get_count(session)
File "/root/miniconda3/envs/liua/lib/python3.9/site-packages/liualgotrader/miners/stock_cluster.py", line 75, in _get_count
"apiKey": get_polygon_credentials(config.prod_api_key_id),
AttributeError: module 'liualgotrader.common.config' has no attribute 'prod_api_key_id'
[<module>()][877405]2021-08-05 14:47:05.394177: market_miner completed
@amor71
@amor71
@jbrass welcome! you're missing your api keys (environment variables). If you want to play around and try to backtest I would suggest following this: https://amor71.medium.com/liualgotrader-part-ii-putting-it-all-together-1d447650808b
Joel Brass
@jbrass
I did specify my Alpaca keys in a file that looks like this https://github.com/amor71/LiuAlgoTrader/blob/master/examples/env_vars.sh and I can see them when I echo $APCA...
I will take another look at the post
@amor71
@amor71
@jbrass will DM you
Joshua Kang
@guppykang
Hey @amor71 any advice on this by any chance?
Traceback (most recent call last): File "/Users/joshuakang/.pyenv/versions/3.9.5/envs/py395/lib/python3.9/site-packages/liualgotrader/scanners_runner.py", line 29, in scanner_runner symbols = await scanner.run() File "/Users/joshuakang/git/trading_bot/liu/v1/../scanners/gold_digger.py", line 29, in run .close[back_time - timedelta(days=90) : back_time] # type: ignore TypeError: unsupported operand type(s) for -: 'NoneType' and 'datetime.timedelta' [scanner_runner()][88091]2021-08-19 10:46:43.546915:[ERROR]Exception in scanner_runner(GoldDigger): exception of type TypeError with args ("unsupported operand type(s) for -: 'NoneType' and 'datetime.timedelta'",)
Joshua Kang
@guppykang
I'm running trader on the gold digger scanner and momentum strategy. Just trying to get something working so that I understand how this library works.
@amor71
@amor71
@guppykang There were a couple of API changes by Alpaca, I'm pushing now v. 0.3.21v with fixes -> can u try to pull it lmk if you still experience the issue? If so we'll dig deeper. Thank you.
@guppykang Incidently, are you sure you wanted to run trader or backtester ... ?
@amor71
@amor71
v. 0.3.21 released. version includes performance improvements (primarily for day-trading)
Joshua Kang
@guppykang
ahh I just started using this today, so probably backtester :). thanks, i'll take a look tonight
@amor71
@amor71
@guppykang assuming you're referring to https://amor71.medium.com/liualgotrader-part-ii-putting-it-all-together-1d447650808b then it uses backtester not trader
@guppykang LMK if that helps
2 replies
@amor71
@amor71
@/all Guys - I appreciate everyone's time - and I understand it's not trivial to start using a platform like Liu and may the documentation is not "tutorial" enough or explains concept enough. I would love to hear your opinions on how you think we should improve the documentation to simplify the "onboarding" of new users. Thank you.
3 replies
Joel Brass
@jbrass
@amor71 I just reviewed the third article. I attempted to backtest the trendfollow strategy first. It looks like the trendfollow strategy is pointing to a library that is in another package. https://github.com/amor71/trading_strategies/blob/master/strats/trendfollow.py#L40 .
I was able to fix it by copying trading_strategies/common/trend.py to into liualgotrader/common/ and rebuilding the module
@amor71
@amor71
@jbrass you shouldnt do that. Its a seperate repo - you should have cloned it ..
in fact you dont need clone the framrwork at all. Just pip install it.
@amor71
@amor71
@/all LiuAlgoTrader v. 0.3.22 released. Thanks much to @riven314 for driving this version.
@amor71
@amor71
@/all v.0.3.25 will be released in a week, includes several performance improvements and new tools. Pull Request open if anyone wants to take a look. It uses OpenTelemetry for tracing and app-monitoring
@amor71
@amor71
NOTE: pull-request merged. master is now latest, I will be running several tests over the next few days and release next week. New Medium article to follow w/ details on how to monitor and trace thruput for day-trading purposes.
@amor71
@amor71
@/all As part of the new release, which focuses on performance improvements, monitoring, tracing, and tuning, I'm sharing here a draft of an accompanying Medium article that I will be publishing later this week / early next week. https://medium.com/@amor71/liualgotrader-internals-performance-tuning-4cbb24fb7eba
Happy for any comments or questions. Have a nice evening (or morning, wherever you are...)
@amor71
@amor71
v0.3.25 was released
@amor71
@amor71
v.0.3.27 released (fix in liu quickstart wizard)
@amor71
@amor71
@/all I would like to share with you that I've started working on adding Crypto features. I'm currently working on a branch to support back-testing crypto-related strategies. Any questions / ideas / suggestions are welcome. Post backtesting I would like to add support for trading, and my primary long-term interest would be on Crypto Futures. Happy to discuss further.
konstik37
@konstik37
Hello, anyone can help me? Where is the config file where I must to set a APCA_API_SECRET_KEY ?
konstik37
@konstik37
I was run liu quickstart for first setup but cant find where config file env
@amor71
@amor71
@konstik37 welcome and thanks for reaching out. You just need to setup the environment variables prior to running liu quickstart. If not clear direct message me here and I'll try to help further.
konstik37
@konstik37

@konstik37 welcome and thanks for reaching out. You just need to setup the environment variables prior to running liu quickstart. If not clear direct message me here and I'll try to help further.

thx, it is work done

Alex Lau
@riven314
excited to hear about adding Crypto features!
@amor71
@amor71
Tearsheet (generated by QuantStats).pdf
This message was deleted
@riven314 Here is a sample BTC/USD arbitrage backtesting, which already bakes in Gemini exchange transaction costs. The platform now supports Equities and Crypto asset types w/ several modifications to back-testing. I'm now going to integrate trading
Data coming from Polygon.io
Alex Lau
@riven314
ok it looks really nice!
by integrating trading data from polygon.io, do u mean my current ticket?