Professional Documents
Culture Documents
Warning:-
Please be aware of Multiple Order Firing, Repainting of Signals & False Future Signals that
occurs in AmiBroker AFL. Ensure that your trading system is error free. Ensure that you have
code in place to restrict multiple Orders from AmiBroker. KiteApp will place all order
requests to OMS from AmiBroker irrespective of whether they are multiple firing or
accidental firing or false firing. Please run your trading system in Semi-Auto mode for at least
one week before going live. This will enable you to check multiple orders firing or other
orders related problem in your Trading System. Please consult any professional coders if you
are not sure about what is said above.
Contents
Those who have already have their Trading System coded in AFL or Excel or any
Programming Language which generates Buy/Sell or Buy/Sell/Short/Cover Signals.
Those clients who want to Programmatically Place order when Signal comes in their
Trading system can use KiteAPI to build their own Platform with custom functions for own
use as it is Pre-Approved by Exchange.
Those who have Trading system & Kite Connect Developer a/c but unable to use of Kite API
due to lack of programming Language.
Those clients, who are in Job, have Good Trading System but unable to trade, can make use
of KiteApp & have their setup in Cloud Server.
Notice:-
We do not support query related to coding & back-testing of your Trading System.
You must code your trading system in your choice of language (AFL, C# etc) on your
own or get it done by Professional coders.
Ensure that your Trading System is Error free & have codes in place to restrict
multiple Orders Firing.
If you do not have trading system coded, then KiteApp may not useful for you.
We only help you to connect your Trading system to KiteApp.
KiteApp is NOT a Buy/Sell software or Charting Software or Technical Analysis
Software.
Current Process of Algorithmic Trading
Source: - https://www.quora.com/Can-automated-stock-trading-work-in-India
Info:-
Algo Trading vs. Auto Trading
Algo Trading:-
Taking trading decisions (buy/Sell) with the help of Computer & Programming
is called Algo Trading. In algo Trading, Buy/sell conditions are defined in coding and
with the help of TA or charting softwares, the conditions are analyzed over the price
data and if any conditions is fulfilled, a signal is generated. Example: Excel, AmiBroker,
MetaTrader etc.
Auto Trading:-
Automatically placing the signal generated from the Trading System as a valid
order in the Trading Platform is called Auto Trading. This eliminates the hassle of
placing the order manually in Trading Platform which are less speed and prone to error
and fat fingering.
Please Be Understand No one will sell you the Money Making Trading System, if the
System is Money making then why they sell it to you instead of use that to Make Money.
Study the Market & work your own Buy/Sell idea, with that idea make your own
Trading System.
How Algo Trading Works
You will get Some Idea about When to Buy/Sell (Ex:- Buy When Prv High Breaks, Sell
When Prv Week Low Breaks etc..MA (100) Crossover)
Convert Your Idea into Coding on Your Own or Get it done by Professional coders
Run Your Trading System on the Past Data to check the Performance
Now decide whether you want to Place Order manually or automatically in Trading
Platform
If automatically, then get Approval for Automation to use with Pi or just build your own
platform using KiteAPI to get started straightway.
If Your Idea is Not Good then Start Again from the Top until You get a Good Idea a.k.a
Trading System
Trial Request
Your request will be processed instantly and you will get the download link and other details in
your email.
We provide one week free trial to test our KiteApp whether it suits to your requirement or not.
If KiteApp fulfills your requirement, then you can Buy KiteApp. KiteApp is Lifetime license
Product. There will not be any monthly/regular commitment. Your client Id will be Pre-Build
with KiteApp & you will be provided with a Permanent download link. Thus Each KiteApp is
Unique to each client. Your KiteApp cannot be used by others.
Requirements
System Requirements:-
Windows 7 or Later
.Net Frame Work 4.0 or above
MS Office 2007 or later (Optional)
Admin Rights
Other Requirements:-
You need a valid Kite Developer A/c with Kite API subscription to use KiteApp.
Kite API subscription will give you a API Key & API Secret which are required to access your
Trading a/c from KiteApp.
If you do not have Kite Developer a/c, then create one as below.
Go to https://developers.kite.trade/login
If you plan to Test Kite API, then pay using Payment gateway, if you pay using back office, your
a/c will be debited every month for auto renewal of API subscription until you delete the API
subscription in Developer A/c.
Post Login : Create APP
App Name : Give any User Friendly Name as per your choice.
Press Create APP.It will redirect to Payment page and post payment your app will be created
and it will have API Key & API Secret which will be used to access your Trading a/c.
https://www.howutrade.in/kitepostback/
https://www.howutrade.in/kitepostback/
Installation
You can scan the installer with AV first and disable Anti Virus for better installation.
Install it as Administrator.
If .Net Framework 4.0 or above not installed, it will download and install automatically.
Notice:-
Always Run KiteApp as Administrator else you will get error. Admin Rights is required to
create Local Web server required for Login Flow.
Initial Setup
Settings
Auto Trade Mode : You can switch between Live and Semi-Auto.
Live : Order will be placed to OMS
Semi-Auto : Order will be logged
You can use your own Email a/c to send trade alerts to your email or other.
Below is setup information for Gmail, if you are using other email please get settings from your
email provider or Google Search for the settings.
You need to Allow Less Secure App in your Gmail a/c else you will not receive any Email Alerts.
Follow the below Steps:-
Go to https://myaccount.google.com
Sing in & Security Connected Apps & Sites Allow Less Secure Apps (ON)
Once done, you can check mail sending using Test mail Button. This will send a sample email to
the To Email mentioned.
Main Components:
Market Watch
You can add required symbols to market watch for which
You are going to trade
You need data in AmiBroker.
You can place Orders from Market Watch itself
Right Click menu will have options to place variety of Order.
Double click to open Market Depth Window
Message Area:
All Order Status and other important infos are displayed here.
Kite API does not support Auto Update Order Status without Post back URL.
For This reason, we have implemented a Method which will check for the Order Status
every 3 sec until the Order Status become COMPLETE or REJECTED or CANCELLED.
Any order related errors also displayed here.
Buttons Panel:
Trade Book
Order Book
Funds
Holdings
Positions
Open Positions
Open Positions Window:
Context Menu
Convert: Convert Position from One Product to Other. Not Applicable for BO/CO Orders
Square Off: There is no API for Square Off. This will just place Opposite Order with same
Quantity in Same Product.
Pending Orders
Pending Orders:
Context Menu:
Semi-Auto Logs
All Orders fired with Auto Trade mode set as Semi-Auto will be logged here.
Double click on an entry will place the Order
Order Windows
Shortcut Keys
F1 - Buy
F2 - Sell
F3 - TradeBook
F4 - OrderBook
F5 - Complete Orders
F6 - OpenOrders
F7 - Position
F8 - OpenPosition
F9 - Holdings
F10 - Funds
F11 - SemiAuto
F12 - settings
Shift + B = BO Buy
Shift + S = BO Buy
AmiBroker Setup
Notice:-
Always Run AmiBroker as Administrator else you will not Get Quotes.
DDE Plugin
COM
DDE Plugin:
It uses AmiBrokers DDE Plugin to Feed Quotes.
KiteApp will act as DDE server & AmiBroker DDE Client.
Pros:
Fast Quote Update
Cons:
Prone to Database Corruption.
Need to Manually Add Symbols in AmiBroker
Little bit Complex Setup.
Problem in import Data into AmiBroker
COM:
Its uses AmiBrokers COM method to Import Quotes
Pros:
Symbols Automatically Added
Simple Setup
Database will never corrupt
Seamlessly import Data into AmiBroker.
Cons:
Not as fast as DDE
Notice:-
Always Start KiteApp and Start AmiFeed First, then Open AmiBroker if the AmiFeed mode is
DDE
Now Go to
Press Ok to close
Database Settings
Window.
If it is still yellow,
Try reconnecting.
Notice:-
In DDE Mode, by default AmiBroker will request quotes only for those symbols for which
chart are open. Let me explain Little bit, suppose you added 30 symbols in AmiBroker, but
you have opened chart for only 3 symbols, then AmiBroker will request quotes for only
those 3 symbols and hence rest 27 symbols will not receive any quotes. To get quotes for
all symbols you have to add all symbols to Real Time Quote Window.
Menu Window Real Time Quote.
Adding each symbol to Quote window is pain, To add all Symbols at Once.Do as follows;
In symbol Pane select all Symbols & Right Click
Select Watch List Add Selected Symbols
Choose List0
Notice:-
Always Start AmiBroker First and then Start KiteApp and Start AmiFeed if the AmiFeed mode
is COM
Notice:-
If AmiFeed Mode is COM, Ensure that the database you are using is your default database else
set it in Menu Preferences Data Default Database Select Your Database.
Bridge Code
Do not Pass Null Values or Array as parameters to Kite Bridge Function else KiteApp
will Crash.
Always Pass correct values, Strings and Numbers.
Example 'C' is array and LastValue(C,1) is Constant Number.
User should aware Of Multiple Order Firing, Repainting Signals and False Future
Signals.
Multiple Order Firing:-
Static Variables are Used to Restrict Multple Order Firing for Single Signal.
Let Me Explain a Bit..It'll be good to Know..
In AmiBroker..Your AFL Code is Executed from top to Bottom whenever Your Chart
Refreshes.
Chart Refreshes, whenever it Receives New Data OR By manually from MenuBar --> View
--> Refresh
For Example, One Min Chart will refresh max of 60 times in i min, assuming data is
received every second.
Suppose..in One Minute Bar, Buy Signal came at the Current Candle..So
LastValue(Buy) is True..So it places Order.
Since the AFL code is Executed at Every Refresh, when New data comes it'll execute
the code again & the Current candle is Still forming.
Again LastValue(Buy) is True, Again Order is Place..It keep on Place Order until
the Next bar where LastValue(Buy) will be False.
To Avoid this we use Static Variables to Restrict Only One Order Per Signal.
Sample codes supplied with KiteApp already has Static Vraible Defined.
*/
if (LastValue(Sell))
{Kite = CreateStaticObject("Kite.Bridge");
Kite.PlaceOrder(Exch, TrdSymbol, "SELL", OrdType, Qty, ProdType, LmtPrice,
TrgPrice, "LONGEXIT");}
if (LastValue(Cover))
{Kite = CreateStaticObject("Kite.Bridge");
Kite.PlaceOrder(Exch, TrdSymbol, "COVER", OrdType, Qty, ProdType, LmtPrice,
TrgPrice, "SHORTEXIT");}
Code For BO
/*Paste the below Code at the End Of AFL.*/
if (LastValue(Sell))
{Kite = CreateStaticObject("Kite.Bridge");
Kite.PlaceBO(Exch,TrdSymbol,"SELL",Qty,LmtPrice,TgtPoints,SlPoints,TrailPoints);}
Code For CO
if (LastValue(Sell))
{Kite = CreateStaticObject("Kite.Bridge");
Kite.PlaceCO(Exch,TrdSymbol,"SELL",Qty,SlPrice);}
Test Order
Performance
Your Internet Speed. Not only speed and also un-interrupted network
At least 512Kb/s is required
Your PC Configurations.
Min 2Gb Ram CPU 2.7Ghz and above
The blue highlighted text is KiteApp related i.e what method/function got error. Just Ignore that
The red Highlighted text is the actual error returned by Kite API.
You can directly contact Zerodha Support with the Red Highlighted Error for clarification.
If kite Server sends response quickly, then KiteApp will show Windows quickly.
If server response is slow, KiteApp will wait for response and show windows.
If server didnt respond, KiteApp will throw error.
Troubleshooting
If Mode is DDE.
Ensure You Open AmiBroker as Administrator
Ensure Ticker is in correct format.
Ensure DDE Server name in Database Settings Configure is AMIFEED & Generic2 selected.
Ensure You added all symbols in Real Time Quote Window.
Ensure DDE mode is selected in KiteApp & AmiFeed is Started.
If Mode is COM
Ensure You Open AmiBroker as Administrator
Ensure the database you are using is Default Database
Ensure COM mode is selected in KiteApp & AmiFeed is Started.
References
https://kite.trade/forum/
https://kite.trade/
https://kite.trade/docs/connect/v1/
Website: https://www.howutrade.in
Reach us at help@howutrade.in
Disclaimer
KiteApp provided by Howutrade Software Solutions LLP is for personal use only and assume that
user is aware of risk involved in programmatic trading and has sufficient programming and coding
knowledge required to use KiteApp & KiteBridge. This software is provided "AS IS" without any
warranties. Howutrade Software Solutions LLP assumes no responsibility or liability for the use of
the software.
Howutrade Software Solutions LLP reserves the right to make changes in the software without
notification. Howutrade Software Solutions LLP also makes no representation or warranty that such
application will be suitable for the specified use without further testing or modification.