In this article, we will discuss the steps required to integrate AutoTrader with any other software. We have already provided buit-in support for Amibroker, MetaTrader & Excel. If you are using any other software (like NinjaTrader) for running your strategies then this article with help you connect with AutoTrader.
Design
AutoTrader uses shared files for communicating with other software. There are files for sending information to AutoTrader as well as receiving information from AutoTrader. These files have comma separated format (csv). They are present at (C:\autotrader\data\order). Click here to see how to change this default path.
Let us understand these files:
- orders.csv
- This is an input file for AutoTrader, which means AutoTrader will read this file to receive information from other software
- You can send commands like place or cancel order to AutoTrader by writing order details to this file.
- AutoTrader reads this files as soon as a change is observed in the file
- platform_orders.csv
- This is an output file of AutoTrader, which means AutoTrader will write information to this file so that other software can read it
- This file contains live details of orders that are present on your trading platform
- AutoTrader writes to this file every N seconds (N can be configured in settings, default value is 10)
- platform_positions.csv
- This is an output file of AutoTrader, which means AutoTrader will write information to this file so that other software can read it
- This file contains live details of positions that are present on your trading platform
- AutoTrader writes to this file every N seconds (N can be configured in settings, default value is 10)
Links: Sample format is available here
Communication
Reference Code
This functionality is already implemented in Excel & Amibroker. If you refer to the code, it will be a lot easier for you to understand. All you need to is to write similar code for your software.
Amibroker code
File Name: C:\autotrader\scripts\amibroker\Formulas\Include\algotrader-util.afl
You can open this file in Amibroker or Notepad.
Excel code
File Name: C:\autotrader\scripts\excel\autotrader.xlam
You will need to go to Developer tab & click Visual Basic to view the code.
Other software -> AutoTrader
This kind of communication is required primarily for actions like place or cancel an order.
Procedure to write to a file
- Prepare your commands
- Open file in append mode (Append means you start witting from the end of file. Do not overwrite any existing data present in the file)
- Write your commands to file (only 1 command per line is allowed)
- Close the file
Place/Cancel Order Command
To place/cancel an order, you need to write order details in a comma separated format explained in this excel sheet (sheet name: orders.csv). To understand more about these columns; please read a section called “Function Variables” in user guide.
Excel Functions: placeOrderAdvanced(), cancelOrder()
Amibroker Functions: placeOrderRAW(), cancelOrder()
AutoTrader -> other software
This kind of communication is required primarily for reading live status of orders & positions on your trading platform. This type of communication is switched off by default. To enable it, go to AutoTrader Settings:
Set PLATFORM_SYNC property value to true.
Procedure to read from a file
- Open file whenever required
- Read all lines
- Close file
Read Live Details of Orders
To get live details of your orders from AutoTrader, read the file platform_orders.csv. The format is explained in this excel sheet (sheet name: platform_orders.csv)
Excel Functions: readOrderColumn(), getOrderStatus() etc.
Amibroker Functions: readOrderColumn(), getOrderStatus() etc.
Read Live Details of Positions
To get live details of your positions from AutoTrader, read the file platform_positions.csv. The format is explained in this excel sheet (sheet name: platform_positions.csv)
Excel Functions: readPositionColumn(), getPositionPNL() etc.
Amibroker Functions: readPositionColumn(), getPositionPNL() etc.
Conclusion
Communicating with AutoTrader is as simple as writing or reading from a file. If you need any help, feel free to contact us.
You can also look at AmiBroker AutoTrader workflow & AmiBroker Strategy Debugging to get more insights.
Additional Information
Changing default path of AutoTrader Files
- Click on AutoTrader menu (Settings -> AutoTrader)
- Find setting IPC_FILES_PATH & click on it
- Click Edit button
- Put new path in Value field
- Click Update
- In amibroker, edit “algotrader-util.afl”. Point it to new path:
ORDER_FILE_PATH = “C:\\autotrader\\data\\temp\\orders.csv”;
PLATFORM_ORDERS_FILE_PATH = “C:\\autotrader\\data\\temp\\platform_orders.csv”;
PLATFORM_POSITIONS_FILE_PATH = “C:\\autotrader\\data\\temp\\platform_positions.csv”;
Hi,
We need to execute an order for multiple clients at a time.Is there any such functionality available with auto trader or ami broker ?
Regards,
June 18, 2018 at 6:32 amHardik
Yes, you can execute orders for multiple clients from either excel or amibroker using AutoTrader. But you will need either NEST or NOW dealer terminal (trading platform).
June 19, 2018 at 6:18 amDoes Auto Trader work with Ninjatrader 8 to place order on Zerodha Kite
July 7, 2018 at 7:34 amAs of now, there is no built in support but you can use this article to make connection.
July 13, 2018 at 4:32 amHi can we use this in ODIN of Angel broking
July 10, 2018 at 6:28 pmYou need to set odin as a platform, please mail us if you need more help.
July 13, 2018 at 4:31 amcan i automate trades with your software on renko chart?
August 24, 2018 at 1:17 pmYes, we provide apis which can work on any chart.
August 27, 2018 at 7:29 amcan i use this auto trader with ninja trader 7.
August 31, 2018 at 6:28 amare you having any ready API for ninjatrader.
if you develop how much you charge for it.
can use with ANT trading terminal which is similar to zerodha terminal.
We do not have Ninja Trader expertise as of now
September 26, 2018 at 11:48 amIf I plan to prepare my strategy on Metatrader n pass commands through csv files as per User manual, is the live feed of data made available to Metatrader as per the package?
How many times in a year have you experienced the RTD feed or interface downtime?
Pls copy your reply to my email also.
September 15, 2018 at 12:12 pmLive price feed is not available in MT4. Max downtimes was 2 hrs & has happened only once so far.
September 26, 2018 at 11:44 amHello sir
September 28, 2018 at 6:02 pmThis is venkatesh
My what’s app no 7729953679
I am use. Amibroker plz add Odin to auto trade pls explain send messages
Please go ahead and try to connect it with ODIN, if you face any issues then send a mail to support.
September 29, 2018 at 7:28 amCan auto trader work with Python and Zerodha.
October 26, 2018 at 1:21 pmYes it can please take a look at this article.
October 30, 2018 at 3:40 amHi,
Will it work with Tradingview?
Thanks,
January 4, 2019 at 4:09 pmBaban
No
January 8, 2019 at 3:32 amThanks for the reply.
January 8, 2019 at 5:47 pmI have created strategy in pine sciprt(Trading view), Then i have to convert it to AFL to test Auto Trader.
Only part I am worried about the stability of Autotrader. (I.e. delay in getting chart data from Kite to Amibroker and also execution)
May I get real tick data in to my Metatrader software?
January 13, 2019 at 12:26 pmMay I get PCR values , required all options data , using Add function() AFL in my Amibroker?
Please reply to my email too.
Thanks for early reply.
Realtime data is only supported in Amibroker.
January 14, 2019 at 6:01 amHi,
Will it work with fyers web?
Thanks,
January 16, 2019 at 4:02 pmSanjay
We already contacted Fyers regarding integration with their platform, but we have not received a response from them. If you can connect us with them, then we will definitely look to provide support for their platform.
January 17, 2019 at 4:19 amDOES AUTOTRADER WORKS WITH ALICE BLUE WEB WHICH IS SIMILAR TO KITE
January 20, 2019 at 9:05 pmNot as of now, we may add support in future.
January 22, 2019 at 3:16 amCan i change AutoTrader writes to this file every N seconds if change what is the value for milliseconds for the file platform_positions.csv and platform_orders.csv
March 20, 2019 at 6:36 amAutoTrader will not accept anything lower than 15 seconds internally. This has been done on purpose to avoid sending too many requests to broker systems.
March 20, 2019 at 9:49 amso it will not be possible to trade on tick chart?
one more question, can I connect it to ICICI direct either on web based platform or trade racer.?
April 24, 2019 at 8:48 amIt is possible to trade on tick chart. Please read more about amibroker and afl language. Not possible on ICICI.
April 30, 2019 at 5:23 amIs it possible to get RT data in to python or .net from kite?
June 28, 2019 at 7:45 amNo
July 2, 2019 at 6:14 ami use sharekhan trade tiger at present,pls tell me that autotrader link works with trade tiger or not.
September 20, 2019 at 4:35 pmif not then which one is best out of “AliceBlue, UPSTOX, NEST, NOW, ODIN & Zerodha KITE platforms” for nse cash, nse futures, nse option
and mcx. compare also for all type of orders like sharekhan.
sharekhan discontinued all eg. excelsheet, amibroker bridge and Api. i am interested in Ema Crossover as well as supertrend Afl for 5 Min , 15 Min ,60 Min intraday charts.
Zerodha Kite & Upstox web works very well.
September 29, 2019 at 6:55 amIhave account in astha and aliceblue . Is it possible to connect auto trader in both account . Is it possible to install autotrader in mobile . Plz give ur valuable suggeztions
October 10, 2019 at 6:27 pmWe only support aliceblue
November 8, 2019 at 7:15 amAre there any support for getting streaming quotes via Autotrader. Lets say I want to monitor BANKNIFTY Price Changes and based on the same place buy/sell orders in realtime.
October 22, 2019 at 11:44 amYes, live quotes from supported with Zerodha Kite & Upstox account into AmiBroker.
November 8, 2019 at 7:14 amDear Sir,
November 27, 2019 at 2:56 amI need to connect Amibroker AFL to Angel broking Speedpro by placing auto buy or sell. Can you please suggest code
Please see list of supported platforms
December 2, 2019 at 3:55 amCan this auto trader be linked with axisdirect web based terminal?
November 30, 2019 at 8:20 amNot as of now, see supported platforms
December 2, 2019 at 3:53 amI have strategy in zerodha Streak. Will the buy sell signals generated by Streak accepted for auto trader.
December 17, 2019 at 6:07 pmNo
December 25, 2019 at 11:19 amHi Sir…. Can I use MT4 just as plug in to place orders by using your API?
August 3, 2020 at 4:29 amhttps://stocksdeveloper.in/documentation/client-setup/metatrader-library/
August 3, 2020 at 8:26 amhi
December 6, 2020 at 3:10 pmcan we you AutoTrader with BSE BEST?
Not sure about that. It works with Omnesys NEST Trader.
December 7, 2020 at 10:33 am