The Scripts section on QuantConnectScripts.com offers many turn-key examples.
You can copy-paste these into QuantConnect, run the scripts, and start playing, understanding and customizing for your own use.
The provided code samples have been tested and will run successfully in QuantConnect.
The detailed steps you need to follow to get any of the code samples to run:
Step 1 – Login to QuantConnect: https://www.quantconnect.com/login
Step 2 – On the Home page, under the ‘Start’ section, click ‘+ Create New Algorithm‘:

Step 3 – Click ‘use Default Template‘:

Step 4 – Select all content in the Main.cs or Main.py file, and delete it
Step 5 – Paste the code you want to test into the Main.cs or Main.py file
Step 6 – Click the ‘Play’ button to build and execute the code

That’s it! Once completed, you will see the results.
If the results are empty, then change the date range used in the code to more recent dates.