How to Build an Algorithm Trading Strategy?

Algorithm Trading Strategy has three main components. To know more about the algorithm trading strategy, please refer What is 'Algorithm Trading Strategy'?

Entry & Exit Section is where you formulate your algorithm trading strategy. 

Let’s first start by selecting

Strategy name: You need to set a unique name to the strategy and Strategy name once saved, cannot be changed. To change the name of an existing strategy, you need to copy the strategy and save with a different name while deleting the source strategy. 

 

Position: It allows users to define the entry type i.e. users has to choose whether he wants to buy or sell or both. Which shall enable the algo to understand, that it has to execute Buy condition or Sell condition first. In case of input provided by user is ‘Both’, then whichever condition matches first buy or sell, will be executed.

  

Interval: The size of the candle depends on the time frame you have opted for. You can select any price bar or candle interval generated starting from 1 minute time interval. The maximum data available for different candle interval is mentioned herein:

 

 

Candle interval

 Data availability

1 Minute

3 months

5 Minutes to 30 Minutes

3 months

1 Hour

6 months

3 Hour

6 months

1 Day

2 years

 

Chart type: You can change the chart type here. The chart types available are Heikin-Ashi or Candlestick.

 

Then move on to defining the BUY and SELL condition of your strategy:

Buy condition

BUY condition that is built with indicators, patterns, and comparators to define the point at which a position can be bought.  It can comprise of one or more conditions, to generate a BUY point. Users can select from 60+ indicators and patterns. To know more in detail about BUY and SELL, for more details, please refer How does the Indicators selection work?

Example: SMA (7) crosses above SMA (14)

 

Sell condition

SELL condition that is built with indicators, patterns, and comparators to define the point at which a position can be sold. It can comprise of one or more conditions, to generate an SELL point. Users can select from 60+ indicators and patterns. To know more in detail about BUY and SELL, for more details, please refer How does the Indicators selection work?

Example: EMA (7) crosses below EMA (14)

 

‘AND’ or ‘OR’ Logic connectors can be used when user wants to combine more than one indicators to form a single entry/exit strategy. You can connect more than one indicator with the help of an ‘AND’ or ‘OR’ connectors, more details please refer How 'AND' or 'OR' Logic Connectors work? 

Stop-loss % and Take Profit %: Stop Loss and Take Profit are the orders which helps user to manage their risk and optimize the strategy return. For more detail please refer Stop-Loss and Take-profit 

Trailing stop-loss: If the security price rises or falls in your favour, the stop loss % moves with it. If the security price rises or falls against you, the stop loss % stays in place. For more detail please refer Trailing-stop-loss

 

  

Graphical Representation of Strategy:

While creating a strategy, and selecting Entry and Exit condition and adding indicators, users can also view the conditions in graphical form on the left side of the page. It helps to visualize multiple conditions, using "AND"/"OR" to collectively form a single strategy with a single entry/exit point event. 

 

Build Strategy Page 2 - Symbol Selection:

  • Symbol: You can select the symbol you want to trade from the equity cash market, future from NSE. You can add a maximum of up to 16 instruments. 

  • Quantity states the number of equity shares or future lots to be used by the strategy.

  • Product type: You can change order type from Intraday (MIS) to Delivery (CNC/NRML). This will change the Backtest results as well.

  • Backtest period: It is the lookback period to perform a Backtest and is defined by selecting the start and stop date for the Backtest. Backtest period can be modified to re-run Backtest i.e. users can change the start and end date of the Backtest period but the period range is limited based on the candle interval.
  • Initial Amount: Cash value to start to backtest & optimisation. Make sure you have enough to run complete backtest & optimisation
  • Save and Backtest Strategy: Once all the mandatory inputs required to Create Strategy are selected or added in the page then the user can click on ‘Save & Backtest'

 

Unable to find an answer?

Looking for anything specific article which resides in general queries? Just browse the various relevant folders and categories and then you will find the desired article.

Raise a ticket