AutoTrader Copyright 2017 by stocksdeveloper.com All Rights Reserved.

Similar documents
AutoTrader. Copyright 2017 by stocksdeveloper.com All Rights Reserved.

AutoTrader Copyright 2017 by stocksdeveloper.com All Rights Reserved.

JSGCL TRADING TERMINAL. User Manual Getting Started

CTRADER QUICKFX TERMINAL

Investnet User Manual INVESTNET USER MANUAL. Powered by FLIP 1

QST Mobile Application for Android

inet PROMPT User Manual USER MANUAL Page 1 of 78

CME E-quotes Wireless Application for Android Welcome

Table of Contents 2 QST MOBILE APPLICATION FOR IPHONE

MT4-TWS Handbook Content

Autochartist Metatrader Plugin Installation Guide

USER MANNUAL. Version 1.9.6

What is DealBook WEB?

MT4 ANDROID USER GUIDE USER GUIDE

Annexure 1 [Algo Test Lab Services User Manual]

FXCC MT4 Android Mobile User Guide

TECH REAL MT4 USER GUIDE

KBC Securities Trader

Checklist for member using Empanelled Vendor CTCL

FEBRUARY 27, 2017 TRADECAST CLIENT PAKISTAN STOCK EXCHANGE LIMITED CATALYST IT SOLUTIONS CATALYST IT SOLUTIONS

KGI HK Mobile Trader (AAstocks) - iphone User Manual

MT4 ANDROID USER GUIDE

FX-GO platform Desktop Trade Terminal - manual V

iphone Trader Login The 5 Main Sections - Favorites - Rates - Positions - History - More

TeleFlash. Internal Research Notes and Custom Data Publisher

ANNEXURE. Page 1. Release of BOLT TWS ver

Customer Activity Monitor (CAM) Users' Guide

BISTECH Pre-Trade Risk Management

FXCC MT4 MultiTerminal User Guide

FXCC MetaTrader 4 User Guide

EPIC Trade Manager. Downloading and Installing:

How to setup RANGE charts on MT4 using the RangeBarChart indicator

MARKET MANAGER. Page 1 of 7

Oracle Beehive. Before Using Oracle Beehive Client and Communicator. Using BlackBerry with Oracle Beehive Release 2 ( )

FXCC MetaTrader 4 User Guide

Tutorial: Create an Excel Dashboard. Overview. **** Download the Example Dashboard ****

Introduction... 2 Trading Profiles... 2 New 2 Strategies ) Order Strategies ) Strategy Builder ) Multiple Order Targets...

Frequently Asked Questions: SmartForms and Reader DC

Table of Contents CLIENT INTERNET ACCESS...4. Mobile Devices...4. Browser Compatibility...4 SYSTEM NAVIGATION Header Links...

GRS Enterprise Synchronization Tool

Electronic Sales Platform User s Manual

1/26/2017 Autochartist - MetaTrader Plugin. MetaTrader Plugin.

SitelokTM. Stripe Plugin V1.5

BTS Trading Station. Quick Reference Guide Cash Markets

OracleTrader User s Guide By Global Profit Systems International LLC

LION Android Trader. User Manual

International Trade Online

TradeGuider RT V4 Quick Install Guide.

- Return the number of pips gained or lost in a previously closed trade

PART 1 - GETTING STARTED LOGIN AND LOGOUT OF EFUTURES... 3

MetaTrader 4 for Android. User Manual

Telemet Mobile Application

Batch Scheduler. Version: 16.0

RHB Futures QST. - Desktop Application User Guideline

EFIS User Guide Family Support Programs User

RSCCD Publications Center Online Submission System. RSCCD Publications Center 1465 N. Batavia St., Orange, CA (714) /5951

N2KExtractor. Maretron Data Extraction Software User s Manual

Publisher Onboarding Kit

HYCM MT4 Client User Guide Provided by Henyep Capital Markets (UK) Limited

CTRADER ALARM MANAGER

USER GUIDE

Hewlett Packard Enterprise Smart Quote

Sync User Guide. Powered by Axient Anchor

Both of these paths will eventually lead you to the Welcome page starting on page 5.

Admin/User Manual SoftPal.com.ng

Purchase and Setup instructions for SWVPS (Sept 15, 2014)

Performing Administrative Tasks

User Guide. 3CX Enhanced Billing Codes. Version

SaxoTraderPRO Intro guide

Fundraising Website Guide

Installation Manual. Introduction

TradeManager Help - Print Version

UBS-SFA Online. User guide. Page 1 of 36

CTP SUBMISSION PLATFORM

Aggregator FX. Client s manual.

Dubai Financial Market

FxPro MT4 for Mac User Guide. FxPro MT4. Version 1.0

RIT VBA API Tutorial

3 Trial of Pro-Server EX

ACER Online Assessment and Reporting System (OARS) User Guide

Ministry of Education

Chapter A2: BankLink Books clients

ADVANTAGE Financial System User Guide County Manager David Hankerson

MetaTrader 4 for iphone. User Manual

Oracle Sourcing Support Helpdesk: Telephone: > Option

Switching to Sheets from Microsoft Excel Learning Center gsuite.google.com/learning-center

Fixed Income Clearing Corporation REAL TIME TRADE MATCHING WEB FRONT END (RTTM WFE) SYSTEM FOR GSD USER GUIDE

2012 Learning Guide Employee. StaffReady.

Nest RTD Help Documentation v1.0 dated 01 Jun 17. Howutrade Software Solutions LLP We Build For You We Code For You. Contents. Know About Nest RTD

CyberSource Business Center

Members are requested to note the following guidelines for using the new Front-end Tradex.

Baby Signs ICI Websites

Quick Guide for Suppliers - Catalogs Supplier Portal (October 2012)

Dell Data Protection Protected Workspace

Your Cart User Manual v3.6

RSA WebCRD Getting Started

Selling Your Photos Online with Snapper.Photo s. PhotoManager. Welcome to the World of. S napper.photo

[ScalpTool Technical User Guide]

FortiNAC Citrix XenMobile Device Integration

UTRADE Stock Options User Guide

Transcription:

Copyright 2017 by stocksdeveloper.com All Rights Reserved.

Table of contents Introduction... 4 What's new... 4 Design... 5 Installation... 6 Amibroker... 6 Realtime Data (RTD)... 7 Installation... 7 Configure Instruments... 11 Backfill... 12 Start/Stop RTD... 13 Issues... 13 Getting Started... 14 Start/Stop Application... 14 Registration... 15 Automated Trading... 16 Test... 18 Bulk Upload... 19 Home Screen... 20 Symbol Mapping... 21 Orders... 22 Alerts... 23 Settings... 24 Integration... 25 Amibroker... 25 Workflow... 26 How to place orders?... 27 Parameters... 29 Functions... 31 Place Order... 31 Order Details... 32 Position Details... 34 Square-off... 35 Default Values... 35 Save Data in Static Variables... 36 Utilities... 36 Logs... 36 Examples... 38 Place order for stock... 39 Place order for future... 41 Place order for option... 43 Place a bracket order... 44 Place a cover order... 45 How to cancel an order?... 46 Excel... 47 Other Softwares (MT4, Ninja Trader)... 49 Function Variables... 50 Settings... 51 2 / 52

Support... 52 3 / 52

Introduction This is a software for trading automatically on KITE 3, NEST (client & dealer), NOW & ODIN terminals. This software also provides live data for all exchanges for KITE users. It provides you a set of functions that can be used to place orders, read order & portfolio status. Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor What's new KITE 3.0 Support added & KITE 2.0 support has been removed Fully & Semi Automated Execution Support for NEST, NOW, ODIN & Zerodha KITE platforms Real Time Data with backfill option for all exchanges (NSE, BSE, MCX) - Only for KITE users Bulk Order Utility for Brokers & Portfolio Managers (Place order for multiple clients) No need to buy API from brokers (No additional expenses for you) More support for KITE, we have provided more functions in algotrader-util.afl for the following: o Bracket & Cover order support added o Order cancellation support added o Fetch order details (status, pending & filled quantity, status message etc.) o Fetch position details (net quantity, buy & sell quantity, M2M, PnL, buy value, sell value, net value etc.) Sound alerts on order placement Support for all market segments o Cash segment o Currency, Index & Stock derivatives o Commodity (This has not been tested, contact support if you face any issues) Free to use & free support o There are no charges for the software as well as the support Easy integration with any charting or analysis software o AutoTrader reads orders from a shared file o To connect it with any software, the charting/analysis software simply need to write orders to a file o AMI Broker support is built-in with examples o To connect it to any other software, contact support Demo strategies provided which show usage of automation functions Supports all order types (Limit/Market/StopLoss) Many other order attributes as well, have a look at sample file here New features & changes o If you need any new enhancements or changes in the software, we will try to build it after analyzing your requirement Help o We have put up a user guide to get you started o You can also contact us for any queries or support 4 / 52

Created with the Personal Edition of HelpNDoc: Write EPub books for the ipad Design All applications that need to place orders, will write the orders into a file. The orders are written into a comma separated format. These orders are picked up by AutoTrader and then placed into trading platform. 5 / 52

Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files Installation Download setup from here. The setup will automatically do a fresh installation or upgrade existing installation if AutoTrader is already installed on your computer. Run setup file (Right Click -> Run as Administrator) & wait for installation to complete, it takes some time so please be patient. Software will be installed in C:\autotrader folder You will have shortcuts created on Desktop now for starting and stopping the server. Go to your desktop, right click on Start-AT shortcut & select properties. On properties window, go to Shortcut tab & click Advanced button. Tick Run as Administrator -> Press OK -> Press Apply Now restart your computer, before moving onto setting up of AmiBroker and Realtime Data. Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites Amibroker Amibroker Integration If you do not have Amibroker software installed then you can install Amibroker free version from here. You must always start Amibroker before starting AutoTrader If your amibroker is installed at one of the following paths, then there is no need to perform following steps. The setup copies the files automatically to these paths: o C:\Program Files\AmiBroker o C:\Program Files (x86)\amibroker If your amibroker is not installaed on above path, then copy following folders manually o Go to folder (C:\autotrader\scripts\amibroker) o Copy all folders inside this folder into your Amibroker installation folder (Example: C:\Program Files\AmiBroker) Select all folders & copy Go to Amibroker installation folder & paste If system asks "Do you want to replace?" then Click YES (Replace All) 6 / 52

Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications Realtime Data (RTD) Realtime Data Video Tutorial is available here. Only available for KITE users, on Google Chrome Browser No need to buy KITE api (AutoTrader does NOT need kite api) Live & backfill data for all exchanges Reliable data (we simply redirect the data that you get in your kite [chrome browser] window to Amibroker) You can configure instruments for realtime download from AutoTrader Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and software Installation Only available for KITE users, on Google Chrome Browser. Realtime Data Video Tutorial is available here. This section explains the installation (setup) process of realtime data. This is one time activity. 1. Make sure you have done Amibroker setup steps given in previous page. 2. Amibroker Run as Administrator 1. Right click on your Amibroker shortcut, click Properties 2. Click Advanced 3. Tick (select) Run as Administrator. 3. Create new database 1. Start Amibroker 2. Click on menu (File -> New -> Database) 3. Select database folder by clicking Browse 1. Select folder (C:\autotrader\rtd\amibroker\autotrader) 2. Tick (select) Load this database at startup 3. Click Create 4. Apply database settings as per the screenshot 1 below 1. Enable local data storage 2. Set number of bars to 30000 3. Set Base time interval as (Tick) 5. Click on Intraday Settings and apply settings as per the screenshot 2 below 1. Tick Show Day Session Only 2. Set market timings as per the exchange you trade 1. Screenshot shows NSE market timings (9:15 to 15:30) 2. If you trade on MCX, then enter 10:00 to 23:30 6. Mark as default database (see screenshot 3 below) 1. Go to Tools -> Preferences 2. Go to Data tab 3. Click on Current Important: You MUST start Amibroker first & then AutoTrader. You must also be logged into Kite on Chrome browser. 7 / 52

Screenshot 1 8 / 52

Screenshot 2 9 / 52

Screenshot 3 If you face any difficulty in installation then please contact us: Phone: +91 9503569907 Email: help@stocksdeveloper.com 10 / 52

Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator Configure Instruments Configure Instruments You must also be logged into Kite on Chrome browser. Make sure you FIRST start Amibroker (Run as Administrator) Then start AutoTrader Click on RTD link on the menu Click on "Download All Instruments", it takes some time 1-2 minutes o This is one time activity o There is no need to do it again & again o Only do it once in a month so that you get all latest derivative instruments You will get an alert when download completes, wait for some time & then try refreshing RTD page Select exchange, segment & instrument type from the dropdown Enter symbol of the instrument & click search You will get the search results Select the instruments you want to add to RTD & click Add to RTD Table at the bottom shows all configured instruments You can also remove instruments from RTD by using Delete from RTD button Note: There is NO NEED to have these instruments added to your marketwatch in KITE. 11 / 52

Created with the Personal Edition of HelpNDoc: Full-featured Kindle ebooks generator Backfill Backfill You must also be logged into Kite on Chrome browser. Make sure you FIRST start Amibroker (Run as Administrator) Then start AutoTrader Click on RTD link on the menu Look for the table RTD INSTRUMENTS Select the instruments you want to backfill Click on Backfill You will get alerts on your home screen once the backfill is complete 12 / 52

Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy Start/Stop RTD Start/Stop RTD You must also be logged into Kite on Chrome browser. Make sure you FIRST start Amibroker (Run as Administrator) Then start AutoTrader To start, click Start Live Prices o All configured symbols' live data will be feed to amibroker o Make sure you have selected Amibroker database as (C: \autotrader\rtd\amibroker\autotrader) To stop, click Stop Live Prices Note: If you want to change certain settings on chart, stop live prices -> change settings > start live prices. Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents Issues Issues All known issues & their solution is documented on support page. 13 / 52

Created with the Personal Edition of HelpNDoc: Easily create iphone documentation Getting Started Once you have completed all the steps in the installation procedure, you can now get started. Created with the Personal Edition of HelpNDoc: Full-featured Help generator Start/Stop Application Start To start an application, double click on the Start-AT shortcut on your desktop. It must always be run as administrator. It takes around 60 seconds for the application to start The system will automatically open a browser & go to address localhost:8080. If it doesn't then open a browser & enter url localhost:8080. o If you are on a network (Wi-Fi), you can access the application from any computer. Just open a browser & enter name of computer on which our AutoTrader is running (Example: your_computer_name:8080 or your_computer_ip_address:8080) You will see the home screen similar to the one below Stop To stop an application, double click on the Stop-AT shortcut on your desktop. 14 / 52

Created with the Personal Edition of HelpNDoc: Free iphone documentation generator Registration On first time login you will be taken to a registration page. You must register here (this is one time process). You need to enter following details: Your email address Your name Contact number NOW/NEST/KITE/ODIN Client id (This is the client id that you use for logging into NOW/NEST terminal. It is required for placing order. It can be changed later through settings) By default, you will get a 30-days trial license. We will extend it on case to case basis, contact us when your license expires. 15 / 52

Created with the Personal Edition of HelpNDoc: Free Web Help generator Automated Trading Run Procedure Steps involved in starting your automated trading. 1. Login to your trading platform (KITE/NOW/NEST/ODIN) 2. Start your analysis application 1. Example, start Amibroker with your strategies running live (or using Bar Reply when testing) 3. Start our service by double clicking Start-AT shortcut on desktop 4. Login to AutoTrader in your browser localhost:8080 5. Click on Start AutoTrader button 6. Click on Start Live Prices (if you are using realtime data from AutoTrader) 7. Run your strategies on live data in Amibroker or Excel 8. Once you have started strategies in Amibroker, just make sure that NEST/NOW is open in FRONT. The NEST/NOW window must be in foreground (in front) for orders to be placed. 9. Whenever an order is placed from strategy, you will hear an alarm. 10. AutoTrader will then immediately place on order onto (KITE/NOW/NEST/ODIN) 16 / 52

Basic Start/Stop Fully Automated Mode On the Home screen, you should see that the system is in a READY state. Press Start AutoTrader button to start automated trading. You can see the system is in RUNNING state. o The system will now wait for orders to come. As soon as the orders come system will place it in your trading platform. Semi Automated Mode To run in semi automated mode, press Stop/Manual o When the system is stopped, it will still read orders but it will not place them To hold/pause automated order placement, press Pause o When the system is on hold; all the orders that are received while the system is on hold will be placed when the system is started again 17 / 52

Created with the Personal Edition of HelpNDoc: Generate EPub ebooks with ease Test Before you start live trading, it is important to do some tests. Good Practice If possible, do testing after market hours During testing, if possible keep zero balance in your trading account (so all orders will be rejected) Otherwise use small quantity limit orders, and use price which is outside circuit limits (Example: price = 1.5, it will make sure that all your orders are rejected) If you follow above rules, then there is no risk accidentally placing an order Test Procedure Here I am giving all the steps that you would take to get automated order placement running. 1. Login to your trading platform (NOW/NEST/KITE) 1. For KITE, only Chrome Browser is supported 2. Start our service by double clicking shortcut on desktop 3. Login to our system, open browser and enter url localhost:8080 4. Click on Start button 5. Start your analysis application 1. Example, start AMI Broker with your strategies 2. Make sure you called placeorder functions from your strategy's AFL 3. Use Bar Reply feature of AMI Broker 6. Once you have started strategies in AMI Broker, just make sure that NEST/NOW is open in FRONT. The NEST/NOW window must be in foreground (in front) for orders to be placed. 7. Whenever an order is placed from strategy, you will hear an alarm. 8. AutoTrader will then immediately place on order onto NOW/NEST/KITE. 18 / 52

Created with the Personal Edition of HelpNDoc: Full-featured Kindle ebooks generator Bulk Upload Bulk Order Upload This feature is useful for brokers & portfolio managers. Using this feature you can place orders for multiple clients in a single click. Note: You must have a nest dealer terminal or rights to place orders on behalf of multiple clients. 1. Please open bulk orders excel file from (C:\autotrader\scripts\excel) 1. BulkOrders-KITE : Bulk order utility for kite users (Allows you to place regular order, bracket order, cover order & after market order in bulk) 2. BulkOrders-OneOrderMultiClient : Single order for multiple clients (dealer terminal) 3. BulkOrders-MultipleOrders : Multiple bulk orders for a single client 2. If you get a warning, then click "Enable Macro". 3. There are 2 sheets where you need to fill data: 1. clients: Enter your client codes here & their respective quantities 2. order: Fill your order details here 4. Click "Place Bulk Order" button. 5. The system by default will wait for 6 seconds (See column S on order sheet). This will give you time to bring NEST/NOW in front. You can modify this value. 6. Bring your NEST/NOW platform to front. 7. AutoTrader will enter same order for all of your clients. Note: To make it even more easy to enter data, you can make multiple copies of excel files for each stock. Please contact us if you have any custom requirement to place orders. 19 / 52

Created with the Personal Edition of HelpNDoc: Easily create iphone documentation Home Screen On top you have (Start/Pause/Manual) buttons. After that you see the current system status Refresh Button is used for reloading alerts & orders on the home screen Alerts table displays last 10 alerts generated by the system Orders tables displays all orders received by the system in current day 20 / 52

Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy Symbol Mapping Symbol mapping is a feature that is very useful, as it saves you a lot of time. A mapping basically maps a key to a security (stock, future etc). Once you have mapped a key, then you need not pass the parameters that are specified in mapping. You can simply place order for a mapped symbol as if you are placing order for a plain stock. Please look at an example below: Here we have create a mapping for key "NIFTY-I". Now we will pass this key in place of symbol. Once you have a mapping in place, you can then call function like the one below in AMI Broker: placeordermappedsymbol("nifty-i", "SELL", "NORMAL", "LIMIT", 10, 9900.5, defaulttriggerprice(), defaultdisclosedquantity()); or placeordermappedsymbol("nifty-i", "SELL", "NORMAL", "LIMIT", 10, 9900.5, 0, 0); Without the mapping you would have to call a function like this (additional fields in pink): placeorderfuture("nfo", "FUTIDX", "NIFTY", "SELL", "NORMAL", "LIMIT", 75, 9900.5, defaulttriggerprice(), "26-OCT-2017", defaultstrategyid(), defaultcomments()); 21 / 52

Created with the Personal Edition of HelpNDoc: Full-featured Documentation generator Orders Orders received by the system are displayed here: To view an order, click on the link of first column (Instrument) of the order row Remember orders are displayed in descending order of time (i.e. latest orders are displayed first) 22 / 52

Created with the Personal Edition of HelpNDoc: Easily create Web Help sites Alerts Alerts generated by the system are displayed here: To view an alert, click on the link of first column (Instrument) of the order row The Name of an alert explains the alert purpose Remember alerts are displayed in descending order of time (i.e. latest alerts are displayed first) 23 / 52

Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents Settings All system settings are present here, they can be viewed & modified from here. 24 / 52

Created with the Personal Edition of HelpNDoc: Create iphone web-based documentation Integration Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents Amibroker Integration with Amibroker To see how to integrate Amibroker, please see these installation steps here. Sample strategies algotrader-util.afl - This file provides various AFL functions that can be used for placing an order. You must include this file in your strategy, so that all functions become available to your strategy AFL. o #include <algotrader-util.afl> at-ema-crossover-simple.afl - This file contains a simple Moving Average Crossover strategy, which shows how to place orders. at-ema-crossover.afl - This file contains a simple Moving Average Crossover strategy, which shows how to place orders & square-off feature. at-order-place-cancel-profit-stoploss.afl - This file contains a simple Moving Average Crossover strategy, which shows how to place orders & cancel order, place profit & stoploss orders. at-bracket-order.afl - This demonstrates the use of bracket orders. at-cover-order.afl - This demonstrates the use of cover orders. 25 / 52

Created with the Personal Edition of HelpNDoc: Free help authoring tool Workflow Let us understand how AMIBroker works with AutoTrader. 1. You write strategy in amibroker. 1. A strategy is basically a set of instructions to tell computer when to buy or sell 2. You use the functions we have provided to place orders 2. 3. 4. 5. 6. 7. You start AutoTrader You login into your trading pltatform (NOW/NEST/ODIN/KITE) You start with a new blank chart You feed live data to amibroker (Start Live Prices) Amibroker runs your strategy every time a new price is received As per logic in your strategy, every time a buy or sell signal is generated the functions that you have written will be invoked to place an order 26 / 52

Created with the Personal Edition of HelpNDoc: Generate EPub ebooks with ease How to place orders? Demo strategies are available in C:\autotrader\scripts\afl How to place order from strategy? 1. Include autotrader-util.afl at the beginning of your fiile. 2. Use place order functions when your Buy, Sell, Cover, Short conditions are true. Lets look at a typical strategy: Code required for automation using AutoTrader is written in gray background Your strategy code is written in yellow background. You can replace the code in yellow background with your own strategy code. #include <algotrader-util.afl> // Moving Average SHORT_MA_PERIOD = Param("Short term moving average period", 20, 1, 200, 2); LONG_MA_PERIOD = Param("Long term moving average period", 40, 1, 200, 2); _SECTION_BEGIN("AutoTrader Demo 1 - Moving Average Crossover"); Exponential Moving averages EMA1 = EMA( C, SHORT_MA_PERIOD); EMA2 = EMA( C, LONG_MA_PERIOD); Buy and Sell Condition Buy = Cross(EMA1,EMA2); Sell = Cross(EMA2,EMA1); Buy = ExRem(Buy,Sell); Sell = ExRem(Sell,Buy); Short = Sell; Cover = Buy; buyprice = ValueWhen(Buy,C); sellprice = ValueWhen(Sell,C); shortprice = ValueWhen(Short,C); coverprice = ValueWhen(Cover,C); Plot Buy and Sell Signal Arrows shape = Buy * shapeuparrow + Sell * shapedownarrow; PlotShapes( shape, IIf( Buy, colorgreen, colorred ), 0, IIf( Buy, Low, High ) ); GraphXSpace = 5; Plot EMA lines and Candles Plot(EMA1,"EMA",colorRed); 27 / 52

Plot(EMA2,"EMA2",colorGreen); Plot(C,"Close",colorRed,styleCandle); if ( LastValue(Buy) == True ) { placeorderusingparams("buy", AT_ORDER_TYPE, AT_QUANTITY, buyprice, defaulttriggerprice(), 1); } if ( LastValue(Sell) == True ) { placeorderusingparams("sell", AT_ORDER_TYPE, AT_QUANTITY, sellprice, defaulttriggerprice(), 1); } _SECTION_END(); Examples: // NEST/KITE/NOW Examples placeorderfuture("nfo", "FUTIDX", "NIFTY", "SELL", "NORMAL", "LIMIT", 75, 9900.5, defaulttriggerprice(), "26-OCT-2017", defaultstrategyid(), defaultcomments()); placeorderstock("nse", "EQ", "SBIN", "SELL", "INTRADAY", "LIMIT", 10, price, 0, 0, 1, "Demo sell order managed by strategy 1"); // ODIN Examples placeorderfuture("nse", "FUTIDX", "NIFTY", "SELL", "NORMAL", "LIMIT", 75, 12000, defaulttriggerprice(), "25-JAN-2018", defaultstrategyid(), defaultcomments()); placeorderstock("nse", "EQUITIES", "SBIN", "SELL", "INTRADAY", "LIMIT", 10, price, 0, 0, 1, "Demo sell order managed by strategy 1"); 28 / 52

Created with the Personal Edition of HelpNDoc: Generate Kindle ebooks with ease Parameters Variables available from algotrader-util afl Every time you include algotrader-util.afl into your strategy code; you will automatically get following parameters added to your chart. These parameters help you to easily configure strategy settings. You can use these variables in your strategy code to get the parameter values configured on chart. Look at the sample strategies provided to understand how it is done. ****************************************************************** * Please read algotrader-util.afl file to understand all functions * provided by AutoTrader. But DO NOT modify the file, if you are * not familiar with AFL coding. * * NOTE: It is recommended to start with a blank chart. ******************************************************************** * Following variables are declared for strategy parameters in * algotrader-util.afl. ******************************************************************** * * AT_SYMBOL : Order symbol * AT_QUANTITY : Order quantity (lot size) * AT_EXCHANGE : Order exchange * AT_INSTRUMENT : Order instrument * AT_PRODUCT_TYPE: Order product type * AT_ORDER_TYPE : Order order type * AT_EXPIRY : Order expiry (expiry date (Example: 28-DEC-2017), pass NA if not applicable) * AT_OPTION_TYPE : Order option type * AT_STRIKE_PRICE : Order strike price * AT_SQUARE_OFF_FLAG: Intraday Auto Square-off (on off) * AT_SQUARE_OFF_TIME: Intraday Square-off Time * ******************************************************************* 29 / 52

How to enter values for these parameters? Right click on amibroker chart & select parameters. 30 / 52

Created with the Personal Edition of HelpNDoc: Full-featured EBook editor Functions This sections explains most of the Amibroker functions/formulae provided by AutoTrader. To better understand these functions & also to look at all available functions; users are advised to read "algotrader-util.afl". But please do not modify the file, if you are not familier with AFL coding. Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator Place Order There are many functions for placing order, you can use any of them as per your need. The names are self explanatory. The description of each parameter that the function takes are given on following pages. * Places an order using parameters defined on the chart. * See documentation above for parameter values. placeorderusingparams(tradetype, ordertype, quantity, price, triggerprice, validate); * Places an order. * See documentation below for parameter values. placeorder(exchange, instrument, symbol, tradetype, producttype, ordertype, quantity, price, triggerprice, optiontype, strikeprice, expiry); * Places an order using mapping. * See documentation below for parameter values. placeordermappedsymbol(symbol, tradetype, producttype, ordertype, quantity, price, triggerprice, disclosedquantity); * Places an order for a stock. * See documentation below for parameter values. placeorderstock(exchange, instrument, symbol, tradetype, producttype, ordertype, quantity, price, triggerprice, disclosedquantity, strategyid, comments); * Places an order for a future contract. * See documentation below for parameter values. placeorderfuture(exchange, instrument, symbol, tradetype, producttype, ordertype, quantity, price, triggerprice, expiry, strategyid, comments); 31 / 52

* Places an order for a option contract. * See documentation below for parameter values. placeorderoption(exchange, instrument, symbol, tradetype, producttype, ordertype, quantity, price, triggerprice, optiontype, strikeprice, expiry, strategyid, comments); * Place an order, this function allows you provide many parameters. And it can be used to place any kind of order. * It will check whether symbol has a mapping in the system. * If a mapping is found, parameters from the mapping are used; otherwise default parameters are used. placeorderadvanced(exchange, instrument, symbol, tradetype, producttype, ordertype, quantity, price, triggerprice, disclosedquantity, optiontype, strikeprice, expiry, clientid, validity, tradertype, marketprotectionpct, strategyid, comments); * Places a bracket order using parameters defined on the chart. * See documentation above for parameter values. placebracketorder(tradetype, quantity, price, target, stoploss, trailingstoploss, validate); * Places a cover order using parameters defined on the chart. * See documentation above for parameter values. placecoverorder(tradetype, quantity, triggerprice, validate); Examples: // NEST/KITE/NOW Examples placeorderfuture("nfo", "FUTIDX", "NIFTY", "SELL", "NORMAL", "LIMIT", 75, 9900.5, defaulttriggerprice(), "26-OCT-2017", defaultstrategyid(), defaultcomments()); placeorderstock("nse", "EQ", "SBIN", "SELL", "INTRADAY", "LIMIT", 10, price, 0, 0, 1, "Demo sell order managed by strategy 1"); // ODIN Examples placeorderfuture("nse", "FUTIDX", "NIFTY", "SELL", "NORMAL", "LIMIT", 75, 12000, defaulttriggerprice(), "25-JAN-2018", defaultstrategyid(), defaultcomments()); placeorderstock("nse", "EQUITIES", "SBIN", "SELL", "INTRADAY", "LIMIT", 10, price, 0, 0, 1, "Demo sell order managed by strategy 1"); Created with the Personal Edition of HelpNDoc: Full-featured Help generator Order Details To use these extra order related features; Go to settings: Set PLATFORM_SYNC property value to true. 32 / 52

* Cancels the order. Pass the order id that you receive from placeorder function. cancelorder(id); * Get order status. * id - should be the id returned by placeorder when you place an order. getorderstatus(id); * Get order quantity. * id - should be the id returned by placeorder when you place an order. getorderqty(id); * Get order pending quantity. * id - should be the id returned by placeorder when you place an order. getorderpendingqty(id); * Get order filled quantity. * id - should be the id returned by placeorder when you place an order. getorderfilledqty(id); * Get order average price. * id - should be the id returned by placeorder when you place an order. getorderaverageprice(id); * Get order timestamp. * id - should be the id returned by placeorder when you place an order. getordertimestamp(id); * Get order platform (NEST, NOW, KITE, ODIN) id. * id - should be the id returned by placeorder when you place an order. getorderplatformid(id); * Checks whether order is open. * id - should be the id returned by placeorder when you place an order. isorderopen(id); * Checks whether order is complete. * id - should be the id returned by placeorder when you place an order. isordercomplete(id); 33 / 52

Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents Position Details * Get position net quantity. * id - symbol which uniquely identifies a position getpositionnetqty(id); * Get position BUY quantity. * id - symbol which uniquely identifies a position getpositionbuyqty(id); * Get position SELL quantity. * id - symbol which uniquely identifies a position getpositionsellqty(id); * Get position M2M. * id - symbol which uniquely identifies a position getpositionm2m(id); * Get position P&L. * id - symbol which uniquely identifies a position getpositionpnl(id); * Get position buy price. * id - symbol which uniquely identifies a position getpositionbuyprice(id); * Get position sell price. * id - symbol which uniquely identifies a position getpositionsellprice(id); * Get position buy value. * id - symbol which uniquely identifies a position getpositionbuyvalue(id); * Get position sell value. * id - symbol which uniquely identifies a position getpositionsellvalue(id); 34 / 52

* Get position net value. * id - symbol which uniquely identifies a position getpositionnetvalue(id); Created with the Personal Edition of HelpNDoc: Produce Kindle ebooks easily Square-off * Square off position as per chart parameters. squareoffposition(); * Square off position. squareoffpositionforsymbol(exchange, instrument, symbol, producttype, optiontype, strikeprice, expiry); Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator Default Values There are many other functions in algotrader-util.afl which provide default values for various parameters. These are useful if there are parameters which are not applicable in your case, then simply call it's respective default value function. defaulttradertype() defaultvalidity() defaultoptiontype() defaultexpiry() defaultclientid() defaultexchange() defaultinstrument() defaultstrikeprice() defaultdisclosedquantity() defaulttriggerprice() defaultmarketprotectionpct() defaultstrategyid() defaultcomments() 35 / 52

Created with the Personal Edition of HelpNDoc: Free Kindle producer Save Data in Static Variables Many times you need to save data for later use. For example, you want to save id of an order you placed for later use (Say, when you want to cancel an order or to see it's status). In such cases you can save data in static variables. There are built-in functions provided by amibroker to save data in static variables, but you need to be careful when using multiple charts. If you use the same key in more than one chart to save data, then amibroker will overwrite the values causing unexpected results. To overcome this problems, AutoTrader provides you similar functions; but these functions create a unique Key per chart. So there is not conflict when using multiple charts. Please see "at-order-place-cancel-profit-stoploss.afl" in the demos to understand how these functions are used. * * Stores numeric value in static variable by preparing a unique chart specific key. atstaticvarset( Key, Value ); * * Retrieves numeric data stored in static variable using a unique chart specific key. atstaticvarget( Key ); * * Stores text value in static variables by preparing a unique chart specific key. atstaticvarsettext( Key, Value ); * * Retrieves numeric data stored in static variable using a unique chart specific key. atstaticvargettext( Key ); Created with the Personal Edition of HelpNDoc: iphone web sites made easy Utilities * Calculates profit order price. calculateprofittarget(entrytradetype, entryprice, profitpct); * Calculates stoploss order price. calculatestoplosstarget(entrytradetype, entryprice, stoplosspct); Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator Logs 36 / 52

Amibroker logs will help you to see what autotrader functions are doing, it is very useful to debug problems. How to see strategy logs in AMIBroker? 1. Enable log window from amibroker menu (Window -> Log) 2. You will see log window at the bottom. 3. Go to "Trace" tab (all strategy logs are printed here). 37 / 52

Created with the Personal Edition of HelpNDoc: Create iphone web-based documentation Examples There are many functions provided by AutoTrader, now let us see some examples of how to use them. To see a list of available functions, click here. To see a list of all variables, click here. To see a list of all chart parameters, click here. Demo strategies should be available in your Amibroker (see screenshot below). 38 / 52

Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy Place order for stock Example 1. Place buy market order with 21 quantity for SBIN stock. // placeorderusingparams(tradetype, ordertype, quantity, price, triggerprice, validate) orderid = placeorderusingparams("buy", AT_ORDER_TYPE, AT_QUANTITY, 0, defaulttriggerprice(), 1); Above function will place an intraday buy market order for symbol = SBIN, quantity = 21, you can see that we are passing variables configured on chart parameters to the function. Parameters 39 / 52

Example 2. Place sell stoploss order with 100 quantity for RELIANCE stock, with trigger price 1100.5 Solution 1: We place orders using parameters // placeorderusingparams(tradetype, ordertype, quantity, price, triggerprice, validate) stoplossprice = 1100.5; // You can calculate stoploss price using your own formula sellprice = stoplossprice - 1; // Sell price a little less than stoploss price placeorderusingparams("sell", "STOP_LOSS", AT_QUANTITY, sellprice, stoplossprice, 1); Solution 2: We place order by passing our own values calculated from code // placeorderstock(exchange, instrument, symbol, tradetype, producttype, ordertype, // quantity, price, triggerprice, disclosedquantity, strategyid, comments); stoplossprice = 1100.5; // You can calculate stoploss price using your own formula sellprice = stoplossprice - 1; // Sell price is a little less than stoploss price orderid = placeorderstock(at_exchange, AT_INSTRUMENT, AT_SYMBOL, "SELL", "INTRADAY", "STOP_LOSS", 100, sellprice, stoplossprice, defaultdisclosedquantity(), defaultstrategyid(), "My stoploss order"); 40 / 52

Created with the Personal Edition of HelpNDoc: Free help authoring environment Place order for future Example 1. Place a sell order NIFTY future 1 lot (lot size = 75). Solution 1: // placeorderusingparams(tradetype, ordertype, quantity, price, triggerprice, validate) orderid = placeorderusingparams("sell", AT_ORDER_TYPE, AT_QUANTITY, 0, defaulttriggerprice(), 1); Above function will place an intraday sell market order for NIFTY MAR 2018 future, quantity = 75 (i.e. 1 lot), you can see that we are passing variables configured on chart parameters to the function. Solution 2: If you need to pass additional parameters then you can do it following way. // placeorderfuture(exchange, instrument, symbol, tradetype, producttype, ordertype, // quantity, price, triggerprice, expiry, strategyid, comments) sellprice = ValueWhen(Sell,C); orderid = placeorderfuture("nfo", "FUTIDX", "NIFTY", "SELL", "NORMAL", "LIMIT", 75, sellprice, defaulttriggerprice(), "25-JAN-2018", defaultstrategyid(), "My derivative 41 / 52

order"); Above function will place an intraday sell market order for NIFTY JAN 2018 future, quantity = 75 (i.e. 1 lot), you can see that we are passing variables configured on chart parameters to the function. 42 / 52

Created with the Personal Edition of HelpNDoc: Easily create Qt Help files Place order for option Example 1. Place a sell market order NIFTY call option at strike 10000, quantity 1 lot (lot size = 75). Solution 1: // placeorderusingparams(tradetype, ordertype, quantity, price, triggerprice, validate) orderid = placeorderusingparams("sell", AT_ORDER_TYPE, AT_QUANTITY, 0, defaulttriggerprice(), 1); Above function will place an intraday sell market order for NIFTY JAN 2018 Call option with strike 10000, quantity = 75 (i.e. 1 lot), you can see that we are passing variables configured on chart parameters to the function. 43 / 52

Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool Place a bracket order Bracket orders are only supported on Zerodha KITE. Example 1. Place buy bracket order for NIFTY FUTURE. // placebracketorder(tradetype, quantity, price, target, stoploss, trailingstoploss, validate) // Assume NIFTY future is trading at 10000, then our target is 10050 and stoploss is 9980. We set trailingstoploss to 2. buyprice = ValueWhen(Buy,C); target = 50; stoploss = 20; trailingstoploss = 2; orderid = placebracketorder("buy", AT_QUANTITY, buyprice, target, stoploss, trailingstoploss, 1); Above function will place a buy bracket order for NIFTY JAN 2018 Future, quantity = 75 (i.e. 1 lot), you can see that we are passing variables configured on chart parameters to the function. Parameters 44 / 52

Created with the Personal Edition of HelpNDoc: Free help authoring tool Place a cover order Cover orders are only supported on Zerodha KITE. Example 1. Place buy cover order for NIFTY FUTURE. // placecoverorder(tradetype, quantity, triggerprice, validate) // Assume NIFTY future is trading at 10000, then we set our stoploss at 9980. liveprice = 10000; stoploss = liveprice - 20; orderid = placecoverorder("buy", AT_QUANTITY, stoploss, 1); Above function will place a buy bracket order for NIFTY JAN 2018 Future, quantity = 75 (i.e. 1 lot), you can see that we are passing variables configured on chart parameters to the function. Parameters 45 / 52

Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool? How to cancel an order? In order to cancel an order, you need to have the order_id. So first you need to save order id. Save order id Every place order function returns an order_id of the order that was placed. We will store this order id in a static variable, so that we can use it later when we want to cancel the order. We will place a limit order here & save the order id in a variable orderid. The function we use for saving order id is atstaticvarsettext(key, value). This function saves the value in a static variable, and makes sure that the key is unique so that it is not affected by strategies running in other charts. orderid = placeorderusingparams("buy", "LIMIT", AT_QUANTITY, buyprice, defaulttriggerprice(), 1); Save entry order id for later use atstaticvarsettext("entry_order_id", orderid); Cancel order Now we use function atstaticvargettext(key) to get order_id that we saved earlier & use it to cancel order. We assume your order is open & you will have some logic based on which you may want to cancel an order if (some_condition) { // Now we want to cancel open order orderid = atstaticvargettext("entry_order_id"); if(isorderopen(orderid) == 1) { cancelorder(orderid); } } 46 / 52

Created with the Personal Edition of HelpNDoc: Free help authoring environment Excel Here we discuss about how to place orders from Microsoft Excel. Readymade Files You will find sample files under C:\autotrader\scripts\excel folder. These files can be used to place orders automatically. BulkOrders-KITE - It is used for sending multiple orders (in bulk) to KITE trading platform. You can place any type of orders (regular order, bracket order, cover order or amo (after market order)) in bulk with a single click. BulkOrders-MultipleOrders - It is used for sending multiple orders to your trading platform. BulkOrders-OneOrderMultiClient - It is used by dealers to place a single order for multiple clients. autotrader-options-buy-call-put - It is an excel sheet which receives signal (from userdefined formula) and based on that buys call or put option If you have any custom requirement to build trade automation in excel then you can contact us. Using automation with your own excel files To make autotrader functions available to your own excel, you will have to install autotrader addin. Steps: 1. The addin is available at C:\autotrader\scripts\excel\autotrader.xlam 2. Copy the file to C:\Users\UserName\AppData\Roaming\Microsoft\AddIns. See this link for more information on how to install addins. Once you have addins install, then you can see all place order functions available in the User Defined category (see below). Double-click on placeorder functions to see list of parameters to pass. Alternatively you can type a function in excel cell: =placeorderstock And press Ctrl + A to see help. 47 / 52

48 / 52

Created with the Personal Edition of HelpNDoc: Write ebooks for the Kindle Other Softwares (MT4, Ninja Trader) AutoTrader can be integrated with any software (like Meta trader, Ninja trader etc.) because it uses a simple file based inter process communication. Read this article which explains how to connect AutoTrader with any other software. 49 / 52

Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation Function Variables VARIABLE_NAME DATA_TYPE DESCRIPTION symbol TEXT It could be a stock symbol or a key which can be mapped to a stock/future/option contract in Mapping menu on AutoTrader tradetype TEXT BUY, SELL, SHORT, COVER producttype TEXT INTRADAY, DELIVERY, NORMAL ordertype TEXT LIMIT, MARKET, STOP_LOSS quantity NUMBER quantity disclosedquantity NUMBER disclosed quantity, pass zero 0 if not applicable price DECIMAL order price triggerprice DECIMAL trigger price (used for stop loss order, in other cases pass zero 0) exchange TEXT NSE, NFO, BSE, BFO, MCX, NCDEX, CDS (maps to exchange column on NEST terminal) instrument TEXT EQ, FUTIDX, FUTSTK, OPTIDX, OPTSTK, FUTCUR, OPTCUR, FUTCOM (maps to instrument column on NEST terminal) optiontype TEXT CE, PE (Option type, pass NA if not applicable) strikeprice DECIMAL expiry TEXT expiry date (Example: 28-DEC-2017), pass NA if not applicable clientid TEXT NEST/NOW client id, pass NA if not applicable validity TEXT DAY, GTD, GTC, IOC (pass DAY if not applicable) tradertype TEXT PRO, CLI (pass CLI if not applicable) marketprotectionpct DECIMAL market protection percentage (Only applicable for Market orders, example 3.0 (which means 3% protection)), pass 0 if not applicable strategyid NUMBER Id of the strategy which should manage this order, pass -1 if not applicable comments TEXT Comments for this order, pass NA if not applicable validate NUMBER variety TEXT Order variety (Regular Order, Bracket Order, Cover Order). Valid values: (regular,bo,co,amo) target DECIMAL Target for bracket order (pass 0 if not applicable) stoploss DECIMAL Stoploss for bracket order (pass 0 if not applicable) trailingstoploss DECIMAL Trailing Stoploss for bracket order (pass 0 if not applicable) strike price, pass zero 0 if not applicable Pass 1 to validate the order, pass 0 to skip validation 50 / 52

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator Settings Name Valid Values Description PLATFORM_NAME NOW, NEST, KITE, ODIN Trading platform name AMIBROKER_DATABAS <path> E Amibroker real time database path Change only if you do not want to use the default database PLATFORM_SYNC true, false Sync is process wherein AutoTrader reads orders, trades & positions from trading platform. This is required in KITE if you want to retrieve order/position details. KITE_ORDER_RETRY_ COUNT 0,1,2,3,4,5 How many times AutoTrader should retry an order, when an error occurs while placing order. On very rare occasions, KITE server gives an error but the order is still placed & hence a retry may end up placing an order multiple times. Hence we have kept the default value to zero. CLIENT_ID <trading_platform_id Trading platform login id, this should be entered > exactly as it is (case-sensitive) DEFAULT_DELAY Between 30 & 300 ORDER_SCREEN_DELA Between 100 to Y 1500 Robot delay (milliseconds). Controls data entry speed on (NEST, NOW & ODIN) platforms. Lower value means faster data entry, but if you set it to very low value; then your computer may not be able to place order properly (1 second = 1000 millis) Delay for order screen to come up. Waits these many milliseconds for order window to show up (1 second = 1000 millis) TRANSACTION_PWD <transaction_pwd> NOW or NEST transaction password (if required) ALERT_FILE BEEP_1.wav, Allows you to select type of alarms SIREN_1.wav, SIREN_2.wav,MUTE 51 / 52

Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool? Support We provide free support in best possible way. For support related queries, we recommend look at known problems & their solutions here. If you cannot find a solution to your issue, then send a mail to us at help@stocksdeveloper.com On-call support: Monday to Friday (9 am to 9 pm) Helpdesk Number: +91 9503569907 Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator 52 / 52