Hello everybody,
I hope this is not considered some sort of “blasphemy” but I dared to try out ChatGPT for QuantConnect strategy generation based on natural language specification, like “please give me an ML based QuantConnect Python strategy” and it worked at generating decent python code.
Here is the main.py
I am unable to understand why it doesn't generate trades.
I think that the condition for signal = 1 (which would mean buying as equivalent to a bull prediction) is never met.
I hope you apreciate the idea :)
Have a nice week start !
Nico Xenox
Hey AlMoJo,
ChatGPT is not trained to program a strategy in QC in most cases the code will be wrong and you will spend more time trying to correct the code rather than writing it on your own.
I can name a few things that are missing for it to work:
2. The program does not enter any function you will have to add this:
3. You will have to use the history request to feed your indicators:
4. At the end you want to probably know what the values will be so you could try to plot them:
Note: I did not take a look at the CreateStopLossAndTakeProfitOrders function. Also not sure why you created a rolling window for the portfolio value you can take a look at it in the backtest results.
Hope it helps ;)
AlMoJo
Thank you very much Nico Xenox it is very kind from you! 😊
AlMoJo
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!