Guidelines for Writing Prompts
  1. Be Specific: Clearly define the trading logic, including entry and exit conditions. Specify the type of assets or markets you’re interested in.
  2. Include Timeframes: Mention the desired timeframes for your strategy, whether it’s intraday, daily, weekly, etc.
  3. Define Indicators: Specify any technical indicators or fundamental metrics you want to incorporate.
  4. Clarify Objectives: State your performance objectives, such as maximizing return, minimizing risk, or achieving a specific Sharpe ratio.
  5. Add Constraints: Include any constraints such as risk tolerance, position limits, or transaction costs.
  6. Iterate and Refine: Start with a simple prompt and gradually refine it based on the AI’s output and your strategic goals.

Examples of Effective Prompts

Example 1: strategies based on technical indicators
Create a strategy for trading U.S. stocks using a moving average crossover technique. 
Use a 50-day simple moving average (SMA) and a 200-day SMA. 
Enter a long position when the 50-day SMA crosses above the 200-day SMA, and 
exit the position when the 50-day SMA crosses below.
Example 2: strategies based on fundamental data
Design a strategy for futures trading based on earnings 
announcements. Enter a position in futures contracts 
if the company reports earnings that exceed analyst expectations 
by more than 10%. Exit the trade one day 
after the earnings announcement. Incorporate a stop-loss of 2% and take-profit of 5%.
If you don’t like result of strategy or if you have error while backtesting try to regenerate zipline engine code