Hello I want a day-trading algorithm that I can trade live. I'm going to run this algorithm live using QuantConnect. I'm going to connect my QuantConnect account to my Schwab trading account to trade this strategy live. Is it possible for you to code an algorithm like this for me?
I want the algorithm to run with second resolution. I want the algorithm to pull live data from my Schwab brokerage account one second after 9:30 ET, right after the market opens. From that data pull, I want my algorithm to make a watchlist of all US equities that opened 10% higher or more than yesterday's close price. I only want the watchlist to include stocks that had $1,000,000 dollar volume during the premarket hours this morning. And I only want the watchlist to include stocks that opened at a share price of $0.25 or higher at the start or regular trading hours this morning.
Once that watchlist is compiled, I want the algorithm to set a buy order for every single stock on the watchlist. The buy order needs to be exactly 10% above the opening share price of the stock. I need the buy order to be for $1,000 worth of the stock based on the buy price.
Then I want the algorithm to monitor every second for when any of the buy orders gets executed. If a buy order is executed, I want the algorithm to immediately set an order-cancels-order exit order. The two prices for this order-cancels-order setup should be exactly 40% above the stock's opening price and 5% above the stock's opening price.
20 seconds before market close, I need the algorithm to liquidate all positions that are currently open and then cancel any orders that are remaining.
Thanks!
Mia Alissi
Here is a complete QuantConnect Python algorithm, as you requested. This code is ready for live trading (including with Schwab, once you connect via the QuantConnect web interface). The code will:
All logic is thoroughly commented within the code for clarity.
To use this for Schwab live trading:
If you need further adjustment or explanation, just let me know!
Sources: Empty Equity And Options400 Benchmark, docs writing algorithms datasets quiver quantitative wallstreetbets, docs writing algorithms datasets quantconnect fear and greed, docs writing algorithms securities asset classes us equity handling data, docs writing algorithms datasets eod historical data upcoming ipos
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Retrospective Green Ocelot
Thanks!
Retrospective Green Ocelot
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!