Inconsistencies between live and paper trading results

I have been working on an intra-day penny stock trading algorithm for the past 5 years using the QuantConnect platform. The backtest results are phenomenal, and profits are reflected in live paper trading with QC data as well. When I connect the algorithm to my Tradier brokerage account however, I only end up losing money.

I have considered a few possible reasons why this could be happening. -Delay between QuantConnect feed data and brokerage

  • Larger spreads preventing more desirable fills.
  • Lack of buyers when it is time to sell holdings

The prices only seem to execute on the 15 minute delayed data Tradier provides, but from my understanding, the delayed data only applies to their own data stream, not the full prices of executed orders.

The QuantConnect paper trading deployment executes orders as soon as live data hits the limit price, but should I expect this same behavior in a production environment?

My algorithm doesn't place orders unless there is a large amount of volume to support price action, so I don't think there should be issues selling them as well.

Given all this, what would all of you think the issue is? Do you think I need to find another brokerage? or do you think QuantConnect's simulated orders are inaccurately filling during paper trade?

Posted Jan 23, 2024, 6:29 AM UTC

48
addictedthinker•

What is going on, and when: Run parallel processes between paper trading and live algo, and compare each order. You'll see the time stamps for each order placed and executed, so you can determine "what" happens and "when" it happens.

Yet another option is to run the algo outside of their environment and compare again.

Those comparisons would make a very interesting post here, that's for sure.

6
Setherof-ValeforOP•

This is definitely the way. My only hesitation with this is purchasing another live node. QuantConnect gets real pricey real fast, and the promise of potential gains lures us in, but statistically failure is most likely.

I have heard that order execution quality in Tradier is poor, and it does seem it is missing a lot of buy orders. I have updated the algo to start chasing the market price with limit orders anytime a profit seems likely, and started using Tradiers sandbox environment today instead of QCs. So far results look promising, but I will wait a month before trading with real money

2
Quant7911•

Hearing people having great success with the QuantConnect platform is amazing. Developing a consistently profitable algorithm is no easy feat.
I've been immersed in the world of QuantConnect for quite some time, and I've even spread the QuantConnect excitement to my friends and university pals!

The issues you describe in the hindrance with backtesting, paper trading, and live trading are certainly perplexing. I would not be too quick to blame QuantConnect though. Their data and trade simulation engines are quite sophisticated and the best in the market.
Rather than a data feed or platform issue, it seems more likely that the challenges lie in the precise nuances of real-time order execution.

As you correctly mentioned spreads, liquidity challenges, and timing can fluctuate randomly in live markets. Execution delays, wider spreads, and lower liquidity can all contribute to slippage between simulated and live fills. And I'm impressed by how QuantConnect has been trying to bridge these gaps.

I would suggest reviewing order fills in detail to see if you can spot any patterns. Are you always buying at the ask and selling at the bid? Are you getting filled on limit orders when you expect? Little details like this can make all the difference and QuantConnect has provided a lot of options from charting to logging features to ease and capture these moments in real time.

You may also want to reach out to the QuantConnect community forums. With over 100,000 members, I'm sure someone if someone has encountered a similar situation and can share your similar problem. The QuantConnect founders and engineers also regularly engage with users there. I have got so many of my problems answered on the forum and the Discord channel.

Overall, I commend you on developing a promising algorithm. With some persistent troubleshooting and optimization, I'm confident you can bridge that final gap between paper and live trading. QuantConnect provides an incredibly powerful platform, especially for intraday strategies. Platforms like QuantConnect can do so much but it's with platforms like these that we can build robust and confident algorithms to trade in the first place.
Keep refining your edge and the profits will follow!

2
mac7109•

I have no clue but I wonder if QC is making money on each trade since they know your algo.

1
Setherof-ValeforOP•

They might be if this algorithm actually works. They promise to not be able to see your algo but I'm not so sure. I would like to believe it's true since they charge so much for back testing and live nodes as it is.

2
mac7109•

I am sure if the algo works, they will copy it. If it is not so good, they will likely try to scalp some gravy off the top. Humans are greedy. I had great results with Quantopian and they went under. The same algo with Quant connect does not work. Something smells in Denmark. I just run the algos for fun and then possibly place trades on my own.

1
Quant7911•

This really can't be the case. QuantConnect is firm on hiding individual work and it is on the user if it wants to get their code out to the public.
Privacy and respecting one's work are paramount concerns for every company. Especially for established firms like QuantConnect, which have dedicated 12 years to building their reputation, it would be illogical to engage in such practices in the first place.

1
jaredbroad•

We provide infrastructure to align with our clients. Putting our clients out of business isn't good business. Check out this if you're interested in learning more.

1
mac7109•

Ill take a look , thanks

1
jaredbroad•

I don't recommend trading penny stocks... especially trying to model them in a backtest/algorithm. But if you insist...

  • Penny stocks have a wide spread and slippage. QuantConnect models the top of book, but not full book depth, so any trades > $1000 will likely not be filled properly. You can confirm this by looking at the trades. Do you have pessimistic slippage models?
  • If select Tradier data feed then any delay would depend on their feed. We default to using our feed which is more reliable than any others we've seen.
  • When limits are hit the orders partially fill according to the size of the counter-party bid. If they're only selling 100 @ $1 you'll only fill 100. You can model this with the Volume Share Fill Model which fills the orders over time.
  • Keep in mind it will only be able to support capital equal to 1-5% of the daily volume of assets traded. E.g. Daily volume = $100K => $1K AUM.
1
Setherof-ValeforOP•

Thank you! This is very helpful.

I have been using only the default slippage model for trading. According to the QC documentation, orders made through the default brokerage model do not experience slippage. All orders placed by my algorithm are limit orders, so I'm not too concerned about that.

You are right about the QuantConnect feed. Upon further research, this is definitely one of the most current and will certainly be my main data source in live trading.

I haven't even tried using the volume share fill model. I feel silly this wasn't already on my radar. I am going to see about using that in my next couple of backtests.

I am using a Tradier paper trading account with my algorithm, and it does seem that it executes orders based on the 15 minute delay while using current market data. so it seems I can only test accurately with real money.

Here's to hoping the latest modification works!

1

I have found that as you increase your resolution, the closer paper trading and live trading become

1
Setherof-ValeforOP•

I ended up having to make a custom fill model that simulated partial fills and execution exactly at the limit price. From there, I tweaked my strategy into something that seems to be profitable as of today. I have been running my strategy for a week and a half and have made a little over 7.5% my initial investment.

1