AlgoBulls logo

Contact Us

Code Using AI

6 min read

If you have creative ideas in your mind and want to design an algotrading strategy, but you are new at coding, don't worry; we have got it covered using our Phoenix's Create Using AI feature which will help you to create trading strategies seamlessly.

Enter your Prompts

  1. On the left-hand side you can see the previous sessions and chat history
  2. Right below you will see a button for Prompts Library which has all the sample prompts that would generate wonderful strategies, you can pick any of them, if needed you can even tailor those prompts and use them.
  3. To start a new session, click on New Session
  4. Enter your prompt or select from the sample prompts or take one prompt from the Prompts Library
  5. Click on the send button to start generating

Note

Please Note, It takes some time to generate the strategy as it processes a lot of data, so please be patient

add-gen-ai-enter-prompt

Warning

Please Note Direct response code from gen-ai may not be 100% accurate, you will have to make sure that pythonic errors are not present. Also dont forget to configure your strategy parameters before executing the code.

Tip

Modify your code ? To know more on how to code trading strategies and understand their format, click here. We also have in detail explanation for regular strategies as well as options strategies.


Tweak Your Strategy

Once you have created your strategy using Copilot, you can futher tweak your strategy using our newly made execute modal called Backtest Config which will help you Backtest, Paper Trade and even Live Trade your strategy. The modal is situated on the top right of the page and provides various facilities which we will now discuss.

New Execute modal in Copilot


i) Primary Broker

Here you can see which broker you are going to use for your trade, and if you want to change your primary broker,

  • You can go to your Broking Details page and switch to whatever broker you want to use. For more details about how to switch/choose your primary broker, you can check this article: Connecting a Broker
  • Once you have changed your primary broker, you can come back to your Copilot Page, where you will be able to see the now updated Primary Broker. If not, click on the refresh button, and you will see your Primary Broker.
Primary Broker


ii) Instruments

Here you will be able to add instruments using the search bar.

  • Search and scroll through your choice's instrument.
  • Delete the instrument that you don't want.
  • You also have an option to click on Randomise which will randomly choose an instrument for you.
Instruments

Note

Choose atleast one instrument before you start trading.


iii) Advanced Customisations

If you want to further customise/tweak your strategy, You can click on this Advanced Customisations which will open a new section named "Execute Strategy".

Advanced Customisations

Note

You can also run the strategy directly from Phoenix. For that you will need to click on the button Live Trade in Phoenix which will take you to the Phoenix Strategy Page. To know more about how to Live Trade in Phoenix Page, Check this article: Introduction to Phoenix

Much like the regular execute modal, here you can:

  1. Open Configuration Modal: Clicking on this button will take you to a new section, where you will be able to configure your Strategy further. Inside this configuration panel, You will be able to change the following parameters.
Advanced Customisations
  • Instrument
    • Set the Trading Symbol and Segment.
  • Strategy Settings
    • Adjust settings like Candle Size and Mode.
  • Order Settings
    • Configure the following order settings for Intraday mode:
      • Resume Positions on Start
      • Exit Intraday Orders on Stop
      • Instrument Max Order Count
      • Crossover Accuracy Decimals
      • Credit Exposure Factor
    • Configure the following order settings for Delivery mode:
      • Resume Holdings T+1 on Start
      • Resume Holdings T+2 on Start
      • Auto Add Instrument Bucket From Positions
      • Auto Add Instrument Bucket From Holdings T+1
      • Auto Add Instrument Bucket From Holdings T+2
      • Exit T+0 Delivery Orders on Stop
      • Exit T+1 Delivery Orders on Stop
      • Exit T+2 Delivery Orders on Stop
      • Max Order Count
      • Crossover Accuracy Decimals
      • Credit Exposure Factor
  • Strategy Parameters
    • Adjust specific parameters based on your trading requirements.

Click on the Save button to save your parameters.

  1. Choose Customisations: In this step, you can choose the time period for which you want to trade. And specify the Quantity(lots) you wish to trade.

  2. Set P&L Trackers: Here, you can track how much profit you want, and how much loss you can take. You can turn it on and off according to your wish.

  3. Start strategy: Click on the Backtest button to start your strategy.

  • You can follow the same steps as in Backtesting for Paper Trade and Live Trade modes.


Viewing Results and Charts

Once you have Backtested/Paper Traded/Live Traded your strategy, scroll down to the following section where you will be able to see results of your strategy run. Here you can find:

View Charts
  • Total Returns (+$31,880.00): This is the overall profit or loss generated by the strategy during the backtest period. In this case, the strategy yielded a net gain of $31,880.
  • Max. Drawdown (0.0008%): Maximum drawdown is the largest percentage decline from a peak to a trough during the backtest. A max drawdown of 0.0008% means the strategy's largest drop was negligible, indicating high stability and minimal risk of large losses.
  • Avg. Hit Ratio (68.18): This refers to the percentage of profitable trades out of all executed trades. A higher hit ratio means the strategy was successful more often than not. If no value is shown here, it would require clarification or completion from the backtest data.

You also have a two buttons below.

  • Show Charts: This will show you charts which depicts the run of your strategy. Charts like Cumulative Returns and Profit and Loss can be found here.

    Cummilative PNL

    Note

    For a more detailed explaination on charts, you can check this article: Charts Overview

  • Get Advanced Analytics: If you want a more detailed explaination of the results, click on the Get Advanced Analytics button which will open a modal, where you can view your strategy result's in a much more detailed version.

    analytics1 analytics2 analytics3