Summary
In this article, we will cover in detail how to write a prompt for Cody and how to optimize it to get the best results.
Details
How to write a prompt
There are a few main elements to include when writing a strategy with Cody:
The amount
By default, the strategy will use the entire allocated capital in the bot parameters.
If you want to specify a different amount you can use either a number or a percentage of the allocated capital.
The trigger / condition
Basically, when to buy and sell. It can be based purely on latest price, a time frame, or some derivative of historical data (calculating moving average for example).
You can build advanced automation using logic connectors like: when, if, or, and, if not, or else, then, etc.
The pair or assets to trade
By default your bot will use the pair selected in the settings.
Note that, if you specify multiple pairs, the backtest functionality will fail.
However, the bot will be able to run multiple pair trading strategies live. If you want to test multiple pairs, consider running multiple backtests with each pair separately.
Tips to improve your prompts
Use clear and concise language.
It's important to use clear and concise language when creating prompts for Cody. This will help ensure that the code generated accurately reflects the intended trading strategy. The prompts should clearly specify when to buy and sell assets, and any relevant conditions or thresholds that trigger these actions. Using simple and straightforward language will make it easier for Cody to generate accurate code.
Do example ✅
Buy $100 of Bitcoin every Monday at 10am Eastern Time, and sell all if the price increases by 10% or more. Repeat this process for 4 weeks.
Do example ✅
Buy $100 of Bitcoin once every day if the price is below 14 day moving average. Keep holding and never sell. Don't buy above $100k.
Don't example ❌
Purchase Bitcoin on a weekly basis at different times based on the market analysis and sell them once they appreciate a good percentage value. Stop trading if the gains are not achieved.
Don't example ❌
Use the best trading strategy and make me rich!
Define your amounts
To ensure that the code generated by Cody accurately reflects the intended trading strategy, it's important to clearly define your order amounts etc. These include:
The amount of assets to buy or sell
Note that you can use a % of your available cash as well as a defined amount
The type of order
You can use: Market, Limit, Stop etc
By defining these variables clearly, Cody can generate code that accurately reflects the intended trading strategy.
Do example ✅
Buy $100 of Bitcoin every Monday at 10am Eastern Time until $1,000 has been spent. If the price of Bitcoin increases by 10% or more, sell all Bitcoin. Use a stop-loss of 5% to limit losses.
Specify your triggers accurately
Once again, to generate an accurate code, make sure to clearly specify your triggers accurately. This includes
Defining clearly the timeframe to use
The exact list of indicators you want to use
Any thresholds that trigger buy or sell actions.
Do example ✅
Buy $50 of Doge when RSI is <30 on the daily chart. Repeat every day until $500 has been spent. Use a take-profit of 10% to lock in gains. If RSI>30 on the daily chart then do not buy.
Don't example ❌
Buy Doge whenever it's cheap and sell it when it's expensive. Don't spend too much money on Doge. This is the most effective way to make money.