cjdietl / microcap_short

Algorithmic trading strategy emitting short signals for MicroCap stocks using the QuantConnect Platform
3 stars 1 forks source link

Hi cjdietl, I'd like to ask questions about microcap #1

Open JangBoo opened 4 years ago

JangBoo commented 4 years ago

Hi cjdietl,

You did very interesting work!

I was able to backtest it after entering premarket on line 83 https://www.dropbox.com/s/ywikhhrr1rn7l92/premarket.json?dl=0. now I'd like to ask three questions before running it live.

Do I have to make finviz_handler, nasdq_handler run every morning to update files on dropbox?

and

Line 63, link made from finviz_handler Line 83, link made from nasdq_handler Line 130, where can I find IB short list? So that I can put it in dropbox.

Lastly, when I just run finviz_handler.py on spyder like this with credential
if name == 'main': scrape() But then somehow html document was saved in finviz.csv from fileaws_tmp.write(r.content), like this https://www.dropbox.com/s/smfjkbqgbr0zdng/finviz.csv?dl=0 I guess I did something wrong. How did you run handler file?

Thank you so much for your great work!

cjdietl commented 4 years ago

Hey Jang Boo,

Thanks for your interest! First and foremost: Don't trade this live with real money! You will lose all your 'investment'. There are multiple issues:

1) The backtest neglects the bid/ask spread. I think the current version on QC includes the spread and loss is quickly 100%.

2) I think if you are selective with the spread and scan for good volume, you might still be profitable, but my research showed that it only works, if you are able to get a fill at the price at the opening auction, which is basically the price which the backtest uses. This is almost impossible as a retail trader I would say and I was never able to get it often enough to be profitable in paper trading.

3) It is tempting to run this algo, since roughly 60% of spiking penny stocks fail quickly, but if you observe the market for a longer time, you will realize that efficiency is even present here and that such simple strategies with such high returns are really improbable.

Nevertheless, I want to help you run the backtest:

I attached the backtest here to see it for yourself: https://www.quantconnect.com/terminal/processCache/?request=embedded_backtest_ee5dd2a73441557bbb900d9c219886de.html

The backtest runs without the various AWS Lambda functions to fetch the data on the web. I found it impractical to run two versions in one (live + backtest). I only ran the live version with paper trading and found the flaws I discussed before.

The handler to fetch the IB Shortlist was missing. I added it to the repo. It's actually quite cool data IB is providing, so I wonder if one can find true alpha in there, since it allows ot generate a live short interest.

I removed the dropbox links since the way to export the PreMarket data is tied to a finviz subscription and I don't wan to get in trouble because of this. Unfortunately, links made it into the uploaded source. The NASDAQ premarket-activity is free though, but I found it less complete than finviz.

Feel free to learn from this, but again, don't trade this exact strategy with real money ! :)

Edit: Also one interesting thing I've found is that usually there are actually shares to short available at IB, so this does not prevent this strategy. The main problem is the spread and that you can't get the market open price in my opinion.

JangBoo commented 4 years ago

Thank you so much for your kind reply!

I might slightly modify your code and backtest it.

If the result is interesting, I’ll let you know!

Thanks a lot, Have a great day! 😊

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Christopher Dietlmailto:notifications@github.com Sent: Friday, April 17, 2020 10:24 AM To: cjdietl/microcap_shortmailto:microcap_short@noreply.github.com Cc: JangBoomailto:janghyuk125@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [cjdietl/microcap_short] Hi cjdietl, I'd like to ask questions about microcap (#1)

Hey Jang Boo,

Thanks for your interest! First and foremost: Don't trade this live with real money! You will lose all your 'investment'. There are multiple issues:

  1. The backtest neglects the bid/ask spread. I think the current version on QC includes the spread and loss is quickly 100%.
  2. I think if you are selective with the spread and scan for good volume, you might still be profitable, but my research showed that it only works, if you are able to get a fill at the price at the opening auction, which is basically the price which the backtest uses. This is almost impossible as a retail trader I would say and I was never able to get it often enough to be profitable in paper trading.
  3. It is tempting to run this algo, since roughly 60% of spiking penny stocks fail quickly, but if you observe the market for a longer time, you will realize that efficiency is even present here and that such simple strategies with such high returns are really improbable.

Nevertheless, I want to help you run the backtest:

I attached the backtest here to see it for yourself: https://www.quantconnect.com/terminal/processCache/?request=embedded_backtest_ee5dd2a73441557bbb900d9c219886de.html

The backtest runs without the various AWS Lambda functions to fetch the data on the web. I found it impractical to run two versions in one (live + backtest). I only ran the live version with paper trading and found the flaws I discussed before.

The handler to fetch the IB Shortlist was missing. I added it to the repo. It's actually quite cool data IB is providing, so I wonder if one can find true alpha in there, since it allows ot generate a live short interest.

I removed the dropbox links since the way to export the PreMarket data is tied to a finviz subscription and I don't wan to get in trouble because of this. Unfortunately, links made it into the uploaded source. The NASDAQ premarket-activity is free though, but I found it less complete than finviz.

Feel free to learn from this, but again, don't trade this exact strategy with real money ! :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/cjdietl/microcap_short/issues/1#issuecomment-615273664, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM54TVMNZVML6GDZ3D2UWV3RNBRB3ANCNFSM4MKD3DZA.