Auto Trade Engine

A. Connecting Scanner and Trading API

TradePoint Desktop trading terminal has two important features.

  • 1- An Ultra Scanner
  • 2- Trading API: Integrate

Ultra Scanner

Ultra Scanner is a multi-charting strategy scanner and one of its kind.

To access it, click Scanner -> Real-time scanner -> Ultra Scanner.

Below are the major features of the Ultra scanner:

  • 1 – Select entry and exit conditions for any charting method
  • 2 – There are pre-defined patterns and conditions to select from. You can create your own strategies in the system builder and select them for entry or exit in the Ultra scanner.
  • 3 – Entry and exit can be done using different charting methods. Entry can be on one timeframe and exit on another and so on.
  • 4 – You can define stop-loss, target or trailing stop-loss along with strategy conditions.

Please click here to read more about the Ultra scanner.

Trading API: Integrate

Integrate is an open source trading API of Definedge Securities.

That API can be used for other applications. It allows you to build trading and financial platforms, execute strategies and more.

Please click here to read complete documentation of the Integrate Trading API.

B. Introduction to Auto Trade Engine

Definedge Autotrader combines both of these features for you and makes the process as easy as possible. With the Auto trade engine, you can connect to the Definedge API even if you do not know any programming knowledge.

Auto Trade engine helps you connect with the Definedge API and Ultra scanner. You can select your strategies in the Ultra scanner and place orders via the auto trade engine.

Before we discuss steps to perform it, let us help you understand Auto Trade engine.

Go to Scanner -> Auto Trade Engine

There are four ways to add the symbol in Auto trade engine:

  • 1 – Add symbol
  • 2 – Import CSV file
  • 3 – Load from the Group.
  • 4 – Add Multi-leg symbols

Before these options are explained, let’s discuss other important fields related to it.

C. Important fields

You need to define strategy id, quantity, symbol and order remark in each of these methods. Let’s understand them.

Strategy ID

You will have to define a Strategy ID in each of these methods.

Strategy ID is the ID code for the strategy you want to run. It will be linked to the Ultra scanner with that ID. You need to define the strategy ID. Strategy ID can be anything numeric, alphabetical or alphanumeric of your choice.

Quantity

You can define quantity or amount of the stock in the auto trade engine while adding symbols.

For example, if you want to place a trade of 100 quantity irrespective of price, put 100 in the quantity column. In case you wish to place an order for Rs. 100000/- irrespective of the price, put 100000 in the amount column.

Consider the example of buying ABC stock at a price of 100. If you mention quantity 100, order will be placed for 100 quantities. If you mention 25000 in this column, the order will be placed for 250 shares (Amount 2500 divided by price 100).

Order remarks

There are order remarks you can write while adding symbols to the auto trade engine. When analysing trade performance in my accounts’ trading journal, these remarks can be very helpful.

You can select this condition in the trading journal and check the performance of these trades for the selected period.

Access the trading journal from My accounts -> trading journal

D. Add symbols

There are four ways to add symbols. Let's discuss adding a stock group in the auto trade engine.

Load from Group

Load from Group is the easiest way to import multiple symbols if your source symbol and target symbol are not different.

TradePoint offers many pre-defined groups in all market segments. You can create your own group using TradePoint Group Manager.

Go to Engines -> Manage Data -> Group Manager to do so.

Select Strategy ID, Exchange, Action and Order remarks.

Select Group of stocks in which you want to place order if the entry or exit conditions are met.

Select a quantity or an amount. The same quantity or amount will be considered for each order.

Select a quantity or an amount

Please note: If it is a F&O segment, quantity is the number of lots and amount is the contract value.

Auto trade engine focuses on the order management and execution. The entry and exit conditions are defined in the Ultra scanner.

In the F&O segment, you can also select an Options ATM scanner for this option.

Options ATM Scanner

When uploading a group in the Auto trade engine, you can click on the Options ATM scanner. It will be linked to Options ATM scanner instead of Ultra scanner in that case.

Go to Scanner -> Real-time scanner -> Options ATM scanner

Options ATM scanner is the same as the Ultra scanner with one difference. Here, the group of stocks is the underlying. Your selected entry and exit conditions will be displayed on the ATM Call and Put Options chart.

For example, Nifty appears in the group of stocks you select. Scanner will check the entry and exit conditions in the ATM option of Nifty. ATM call or put option, wherever the signal is qualified, it will be added to the entry option of the Options ATM Scanner .

When ATM option is enabled in the Auto engine while uploading the group, orders will be placed in the ATM option.

In the Options ATM scanner, you should provide the same strategy ID that you defined when loading a group of symbols.

When you add a symbol, you also define the exchange, order type, and quantity or amount for which you wish to trade.

E.Auto trade engine Order setup

You can define the Max option positions that you want to keep. Further entry orders will not be placed once this limit defined by you is hit.

Max Loss (P&L) is the maximum loss you can define. Target P&L is a the target profit. Upon reaching Max loss or Target, Ultra scanner will stop. It will not take further entry signals.

If you want to auto square off all open positions when the target or stop-loss is hit, click on the auto square off button.

Open positions, realised P&F, unrealised P&L and total P&L tabs will show real-time calculations of the strategy you are running in the auto trader. Please note: The P&L calculation gets updated in every 15 seconds.

You can remove any scrip by the Auto trade engine if you don’t want to run auto trade engine on that scrip. You need to manually exit that stock in that case.

F. Steps to follow

Now, you have a clear understanding of how to use Auto trade engine.

You also know how to run an Ultra scanner.

It is possible to connect both of them and execute your trading strategies through them. Below are the steps to achieve that.

  • 1 – Open the Auto trader engine and add symbols and quantity or amount as explained above. Mention strategy ID while adding symbols.
  • 2 – Start the Algo engine. This is linked with the Definedge Trading API.
  • 3 – Open Ultra Scanner and select your entry and exit strategies as explained above.
  • 4 – Ultra scanner and Auto trade engine are linked with strategy ID. Put the same Auto trade engine strategy ID in the Ulta scanner here and click on the box.
  • 5 – Start the Ultra scanner. This will connect to the Definedge Trading API linked with the Algo engine.

Now your Ultra scanner and Auto Trade engine are connected. When conditions defined in the Ultra scanner are met, the order will be placed as directed.

You can also open multiple Auto trade engines and Ultra scanner for multiple strategy IDs.

Please note that you can define group of stocks in Ultra scanner and Auto trade engine as well. Orders will be placed based on groups selected in the Auto trade engine. Both places can have the same group. It is also possible to have limited symbols in Auto trade engine, but a large number in scanner group.

Let’s return to the Options ATM scanner.

G. Important terms & conditions

Auto trade engine facilitates connecting your strategies to the trading API for better execution. However, it needs your constant monitoring and intervention.

Please read the terms below carefully.

  • 1. With Auto trade engine, you are connecting to API for placing orders that come under your scanner conditions.
  • 2. The software is designed to connect with your scanner via API. But it doesn’t guarantee any profit or prevention of loss.
  • 3. The past performance of software or any trading strategy doesn’t guarantee future results. Please study the scanner conditions carefully before using.
  • 4. You should ensure that you have adequate knowledge and experience of trading before using this feature.
  • 5. The performance of trades depends on the trading strategy you designed. We don’t recommend strategies. Please study your strategies carefully before implementing.
  • 6. Order placement may fail due to technical issues or network connectivity. You are supposed to monitor the connectivity of the software.
  • 7. TradePoint or any Definedge member will not be liable for any losses or damages occurred because of using this feature or any technical issue or any other reason for causing the trouble.

H. FAQ

Here are some questions you might have.

You need absolutely no coding knowledge to define strategies in the system builder of TradePoint. You can select any pattern, indicator or combination of them from any charting method. There are many possibilities for designing trading strategies in the system builder.

Click here to learn how to use the system builder.

Yes, you can run this scanner on any group and segment. TradePoint has pre-defined groups for mid caps and small caps. All NSE and BSE defined groups are available in TradePoint. You can create your own stock group.

Yes, make sure Nifty is part of the Ultra scanner group. Nifty should be your source symbol. Options can be a trading symbol.

Yes, you can do that. Choose Add symbol option, select source symbol as Nifty and trading symbol as straddle or strangle.

Yes, you can select exchange as NFO and group of options in the Ultra scanner and Auto trade engine. Orders will be placed in Options symbols when conditions are qualified in those symbols.

Yes. While loading the group in Autotrade engine, enable the ATM option scanner. Run the Options ATM scanner and select the underlying group. Provide the strategy ID for the auto trade engine and run the scanner.

It is an intraday auto trade engine but you can use it for exiting positional trades as well.

The scanner stops at the time you specify. You convert your entries manually from intraday to positional.

You can define the stop time of the auto trade engine. It will start when you click on the start button. Entry and exit time switch during intraday is not available.

Yes, check the Multi-leg symbol explanation above.

Auto Trade Engine

Index

  • A. Connecting Ultra scanner and Definedge Trading API
  • B. Introduction to Auto Trade Engine
  • C. Important fields: Strategy ID, Quantity, Symbol types and Remark
  • D. Four ways to add symbols for trading via Auto trade engine
  • E. Auto trade engine Order setup
  • F. Steps to connect Ultra scanner and Auto trade Engine via Trading API
  • G. Important terms & conditions
  • H. FAQ

A. Connecting Ultra scanner and Definedge Trading API

TradePoint Desktop trading terminal has two important features.

  • 1- An Ultra Scanner
  • 2- Trading API: Integrate
  Ultra Scanner

 Ultra Scanner is a multi-charting strategy scanner and one of its kind.

 To access it, click Scanner -> Real-time scanner -> Ultra Scanner.

 Below are the major features of the Ultra scanner:

  • 1 – Select entry and exit conditions for any charting method
  • 2 – There are pre-defined patterns and conditions to select from. You can create your own strategies in the system builder and select them for entry or exit in the Ultra scanner.
  • 3 – Entry and exit can be done using different charting methods. Entry can be on one timeframe and exit on another and so on.
  • 4 – You can define stop-loss, target or trailing stop-loss along with strategy conditions.

Please click here to read more about the Ultra scanner.

Trading API: Integrate

Integrate is an open source trading API of Definedge Securities.

That API can be used for other applications. It allows you to build trading and financial platforms, execute strategies and more.

Please click here to read complete documentation of the Integrate Trading API.

B. Introduction to Auto Trade Engine

Definedge Autotrader combines both of these features for you and makes the process as easy as possible. With the Auto trade engine, you can connect to the Definedge API even if you do not know any programming knowledge.

Auto Trade engine helps you connect with the Definedge API and Ultra scanner. You can select your strategies in the Ultra scanner and place orders via the auto trade engine.

Before we discuss steps to perform it, let us help you understand Auto Trade engine.

Go to Scanner -> Auto Trade Engine

There are four ways to add the symbol in Auto trade engine:

1 – Add symbol

2 – Import CSV file

3 – Load from the Group.

4 – Add Multi-leg symbols

Before these options are explained, let’s discuss other important fields related to it.

C. Important fields

You need to define strategy id, quantity, symbol and order remark in each of these methods. Let’s understand them.

Strategy ID

You will have to define a Strategy ID in each of these methods.

Strategy ID is the ID code for the strategy you want to run. It will be linked to the Ultra scanner with that ID. You need to define the strategy ID. Strategy ID can be anything numeric, alphabetical or alphanumeric of your choice.

Quantity

You can define quantity or amount of the stock in the auto trade engine while adding symbols.

For example, if you want to place a trade of 100 quantity irrespective of price, put 100 in the quantity column. In case you wish to place an order for Rs. 100000/- irrespective of the price, put 100000 in the amount column.

Consider the example of buying ABC stock at a price of 100. If you mention quantity 100, order will be placed for 100 quantities. If you mention 25000 in this column, the order will be placed for 250 shares (Amount 2500 divided by price 100).

Source and Trading Symbol

 You need to mention the symbol or scrip for trading. There are two types of symbols: Source symbol and trading symbol.

Source symbol is a scrip name on which your entry or exit conditions will be met. Your trading symbol is the one in which you want to place your order.

For example, if you want to place an order in Nifty CE when entry or exit conditions are met in Nifty future, then your trading symbol is Nifty CE and the source symbol is Nifty Future.

As an example, you would like to purchase Nifty 18000 CE in April if the entry condition is met for Nifty near month futures.

As a result, your Source Exchange will be NFO and your Source Symbol will be Nifty-I. Your Trading Exchange will also be NFO but your Trading Symbol will be NIFTY 29-Apr-2023 1800 CE.

Source and trading symbols can be same or different. In simple strategies, source and trading symbols will be same.

Order remarks

There are order remarks you can write while adding symbols to the auto trade engine. When analysing trade performance in my accounts’ trading journal, these remarks can be very helpful.

You can select this condition in the trading journal and check the performance of these trades for the selected period.

Access the trading journal from My accounts -> trading journal

D. Four ways to add symbols for trading via Auto trade engine

Let’s now discuss the methods to add symbols.

1 – Add Scrip

This option is easy but more suitable when your source and trading symbols are different. You can add a single symbol at a time and mention its trading symbol while adding.

Entry could be long or short. When adding the symbol for a bullish strategy, select entry buy and exit sell. Otherwise, select entry sell and exit buy.

Your trading symbol can also be more dynamic. There are three other options that you have: ATM, Straddle and Strangle.

ATM: Select ATM option and type the name of the scrip you want to trade as an ATM option. Select an expiry date. Select CE or PE for the ATM option in which you want to place the order.

For example, if your trading symbol is Nifty Future and the source symbol is ATM, the scanner will identify ATM option of the Nifty Future when the entry condition is met on the Nifty Future. The trade order will be placed on the Nifty ATM option.

Straddle: You can also choose the straddle symbol. For example,
you want to trade Nifty straddles when entry conditions
in Nifty futures are met. Select the Straddle option,
select the symbol, and select the expiration date.
Keep 0 in strike if you want to trade ATM straddles.
Select a width away from ATM strike if you want to trade other
strike prices. For example, if you keep width as 100,
the order will be placed in a straddle of 100 points above
ATM strike price. If you select -100, the order
will be placed in a straddle of 100 points below ATM strike price.

Strangle: You can also trade strangles. Select the distance of CE and PE for the strangle order.

Select action as entry buy and exit sell if you want to buy straddle, strangle or ATM option. Select action as entry sell and exit but if you want to short straddle, strangle or ATM option.

Select Quantity or amount of which you want to place the order.

The entry and exit conditions on the source symbol are defined in Ultra scanner. We will discuss how to link Ultra scanner with Auto trade engine.

2 – Add Instrument CSV file

If you want to add multiple stocks to the Auto Trade Engine file, you can add a CSV file instead of adding them one by one.

You can download the sample Excel file from the below link.

Download Sample File 

CSV file Column explanation:

Source Exchange (Column A): It is the market segment in which you run the scanner. E.g. NSE, BSE, NFO, MCX or CDS.

Source Symbol (Column B): It is the name of the symbol on which the condition will be qualified in the Ultra scanner. Eg. Nifty.

Trading Exchange (Column B): It is the exchange on which you wish to place an order. E.g. NSE, BSE, NFO, MCX or CDS.

Trading Symbol (Column D): It is a symbol on which an order will be placed if the condition in the source symbol is met. Eg. Nifty.

Quantity (Column E): Number of shares or the quantity you want to place. If you are placing derivative orders, you should specify the total quantity instead of the number of lots. For instance, you wish to purchase ten lots of Nifty futures. It has a lot size of 75. You need to mention 750 in the quantity column and not 10.

Remark (Column F): This is a remark for your reference. The separate P&L of trades based on this remark can be found in your My Account section in the trade journal.

Strategy ID (Column G): Mention a strategy ID. You must select this ID when running the Ultra scanner.

Amount (Column H): Mention the amount for which you want to buy the stocks.

Please note that you should only enter values in the Quantity column (Column E) or the Amount column (Column H).  When you enter a value in the quantity column, you should enter a zero in the amount column. When you enter a value in the amount column, you should put a zero in the quantity column.

As explained earlier, there can be a difference between the Source Exchange and the Trading Exchange or the Source Symbol and the Trading Symbol.

3 – Load from Group

Load from Group is the easiest way to import multiple symbols if your source symbol and target symbol are not different.

TradePoint offers many pre-defined groups in all market segments. You can create your own group using TradePoint Group Manager.

Go to Engines -> Manage Data -> Group Manager to do so.

Select Strategy ID, Exchange, Action and Order remarks.

Select Group of stocks in which you want to place order if the entry or exit conditions are met.

Select a quantity or an amount. The same quantity or amount will be considered for each order.

Please note: If it is a F&O segment, quantity is the number of
lots and amount is the contract value.

Auto trade engine focuses on the order management and execution. The entry and exit conditions are defined in the Ultra scanner.

In the F&O segment, you can also select an ATM Ultra scanner for this option.

Options ATM Scanner

When uploading a group in the Auto trade engine, you can click on the Options ATM scanner. It will be linked to Options ATM scanner instead of Ultra scanner in that case.

Go to Scanner -> Real-time scanner -> Options ATM scanner

Options ATM scanner is the same as the Ultra scanner with one difference. Here, the group of stocks is the underlying. Your selected entry and exit conditions will be displayed on the ATM Call and Put Options chart.

For example, Nifty appears in the group of stocks you select. Scanner will check the entry and exit conditions in the ATM option of Nifty. ATM call or put option, wherever the signal is qualified, it will be added to the entry option of the Ultra scanner.

When ATM option is enabled in the Auto engine while uploading the group, orders will be placed in the ATM option.

In the Options ATM scanner, you should provide the same strategy ID that you defined when loading a group of symbols.

4 – Multi-leg symbols

Multi-leg symbols help you trade spreads and other different options trading

strategies upto six legs when the technical signal is qualified in the underlying.

You have to add each leg and you have different choices for the strike price selection of these legs.

Select the Add Multi-leg symbol option. Add the strategy ID and a remark. Select the source symbol. This will be linked to the Ultra scanner with the same strategy ID.

Select the multi-leg symbol and expiry.

Select options type (call or put) and action (buy or sell).

There are 3 options for defining the strike price.

  • Width
  • Delta
  • Price

Width: Width is the distance from the current strike price. 0 is ATM. 100 is 100 points above ATM and -100 is 100 points below ATM.

Delta: Delta is the strike price having Delta above or below the level you define. If it is above Delta 70, the first strike price above 70 Delta will be considered. If it is below 30, the first strike price below 30 will be considered. 

Price: Price above and below the level you define will be considered. If the price is above 100, the first strike price above Rs. 100 will be considered. If it is below 100, the first strike price below 100 will be taken into account. You can define the quantity and add the legs.

In the event that the entry condition in the underlying is triggered,
the order will be placed in all legs.

For example, if you want to buy BankNifty spread when the
BankNifty goes above the moving average. Select entry condition in Ultra scanner on Bank Nifty. Source symbol and Multi-leg symbol in Auto trade engine will be Bank Nifty.

Select the call by option, type (width, delta, price) of the first leg in the spread, and then add the same information for the second leg in the spread.

You can add up to 6 legs to this scanner. Minimums are 2.

When the exit condition is fulfilled, all open legs will be squared off.

Now, you know the different ways to add symbols for trading in the Auto trade Engine. When you add a symbol, you also define
the exchange, order type, and quantity or amount for which you wish to trade.

E. Auto trade engine Order setup

You can define the Max option positions that you want to keep. Further entry orders will not be placed once this limit defined by you is hit.

Max Loss (P&L) is the maximum loss you can define. Target P&L is a the target profit. Upon reaching Max loss or Target, Ultra scanner will stop. It will not take further entry signals.

If you want to auto square off all open positions when the target or stop-loss is hit, click on the auto square off button.

Open positions, realised P&F, unrealised P&L and total P&L tabs will show real-time calculations of the strategy you are running in the auto trader. Please note: The P&L calculation gets updated in every 15 seconds.
You can remove any scrip by the Auto trade engine if you don’t want to run auto trade engine on that scrip. You need to manually exit that stock in that case.

F. Steps to connect Ultra scanner and Auto trade Engine via Trading API

Now, you have a clear understanding of how to use Auto trade engine.

You also know how to run an Ultra scanner.

It is possible to connect both of them and execute your trading strategies through them. Below are the steps to achieve that.

1 – Open the Auto trader engine and add symbols and quantity or amount as explained above. Mention strategy ID while adding symbols.

2 – Start the Algo engine. This is linked with the Definedge Trading API.

3 – Open Ultra Scanner and select your entry and exit strategies as explained above.

4 – Ultra scanner and Auto trade engine are linked with strategy ID. Put the same Auto trade engine strategy ID in the Ulta scanner here and click on the box.

 5 – Start the Ultra scanner. This will connect to the Definedge Trading API linked with the Algo engine.

Now your Ultra scanner and Auto Trade engine are connected. When conditions defined in the Ultra scanner are met, the order will be placed as directed.

You can also open multiple Auto trade engines and Ultra scanner for multiple strategy IDs.

Please note that you can define group of stocks in Ultra scanner and Auto trade engine as well. Orders will be placed based on groups selected in the Auto trade engine. Both places can have the same group. It is also possible to have limited symbols in Auto trade engine, but a large number in scanner group.

Let’s return to the Options ATM scanner.

G. Important terms & conditions

Auto trade engine facilitates connecting your strategies to the trading API for better execution. However, it needs your constant monitoring and intervention.

Please read the terms below carefully.

1. With Auto trade engine, you are connecting to API for placing orders that come under your scanner conditions.

2. The software is designed to connect with your scanner via API. But it doesn’t guarantee any profit or prevention of loss.

3. The past performance of software or any trading strategy doesn’t guarantee future results. Please study the scanner conditions carefully before using.

4. You should ensure that you have adequate knowledge and experience of trading before using this feature.

5. The performance of trades depends on the trading strategy you designed. We don’t recommend strategies. Please study your strategies carefully before implementing.

6. Order placement may fail due to technical issues or network connectivity. You are supposed to monitor the connectivity of the software.

7. TradePoint or any Definedge member will not be liable for any losses or damages occurred because of using this feature or any technical issue or any other reason for causing the trouble.

Auto Trade Setting in TradePoint Desktop Terminal

Connect to the Definedge Securities API and set up auto trading for your preferred market segment and charting type.

The Auto Trade system will be connected to the Ultra scanner (Scanner -> Real-time scanner). The Ultra scanner enables you to select your trade entry and exit conditions and to mention your strategy ID by checking the box. Definedge trade API is connected to the Ultra scanner, which will be linked to the Auto Trade Setting window.

The Auto Trade Setting window (Settings Menu) allows you to add instruments. It is these instruments on which you wish to place orders, and it can be a separate list from the stock list selected in Ultra scanner.

You can also upload an Excel file with a list of symbols and quantities.

You can download the sample Excel file from the below link.

Source Exchange (Column A): It is the market segment in which you run the scanner. E.g. NSE, BSE, NFO, MCX or CDS.

Source Symbol (Column B): It is the name of the symbol on which the condition will be qualified in the Ultra scanner. Eg. Nifty.

Trading Exchange (Column B): It is the exchange on which you wish to place an order. E.g. NSE, BSE, NFO, MCX or CDS.

Trading Symbol (Column D): It is a symbol on which an order will be placed if the condition in the source symbol is met. Eg. Nifty.

Quantity (Column E): Number of shares or the quantity you want to place. If you are placing derivative orders, you should specify the total quantity instead of the number of lots. For instance, you wish to purchase ten lots of Nifty futures. It has a lot size of 75. You need to mention 750 in the quantity column and not 10.

Remark (Column F): This is a remark for your reference. The separate P&L of trades based on this remark can be found in your My Account section in the trade journal.

Strategy ID (Column G): Mention a strategy ID. You must select this ID when running the Ultra scanner.

Amount (Column H): Mention the amount for which you want to buy the stocks. Consider the example of buying ABC stock at a price of 100. If you mention 25000 in this column, the order will be placed for 250 shares (Amount 2500 divided by price 100).

Please note that you should only enter values in the Quantity column (Column E) or the Amount column (Column H).  When you enter a value in the quantity column, you should enter a zero in the amount column. When you enter a value in the amount column, you should put a zero in the quantity column.

There can be a difference between the Source Exchange and the Trading Exchange or the Source Symbol and the Trading Symbol.
As an example, you would like to purchase Nifty 18000 CE in April if the entry condition is met for Nifty near month futures.

As a result, your Source Exchange will be NFO and your Source Symbol will be Nifty-I. Your Trading Exchange will also be NFO but your Trading Symbol will be NIFTY 29-Apr-2023 1800 CE.

Open Demat Account