Amibroker Automation

Ganesh
I have developed a strategy in Amibroker. I also have subscription to Kite connect API. How can I automate via Amibroker? Based on Amibroker signals it should automatically place order and place SL. Then keep modifying Trailing SL order.

I have also tried to automate using .Net API however I am not able to get match RSI, ATR values with Amibroker (Some how Amibroker calculates RSI and ATR differently that the standard used normally in libraries like Ta-Lib.) .

So I am thinking to automate directly from Amibroker if that's doable. If anyone has any idea please suggest.

Thanks,
Ganesh
  • MadanGoyal
    I have a similar situation. Need to automate my AFL strategies triggered signals to Kite Connect API.

    Any ideas?? Anyone...

    Thanks,
    Madan
  • pivottrading.net
    As far as my understanding goes, Kite connect api's are meant for pure programmers who do their raw level coding.

    For Amibroker integration.i think Pi bridge is correct option. Still Kailash and Vivek may tell better.
  • rktheinvestor1
    rktheinvestor1 edited November 2016
    Hi,
    I beleive you can do it. You will need to have a logical layer between Amibroker and Kite Connect API.

    1. Run amibroker analysis at regular intervals
    2. Write buy/sell/tgt/exit files in json format to a directoy
    3. Have your java/.net/php/python code logic, to listen to this directory, parse json and call appropriate APIs

    Pi bridge is an option but i am not sure if latest version supports all order types, last time when i was trying, it did not support BO. Kite connect API integration will be fully automated whereas Pi - bridge will still require us to push a button to execute the orders. And i feel we won't have time and speed advantage that we will have with Kite connect API

    Thanks,
    AarKay
  • Ganesh
    @MadanGoyal and @rktheinvestor1 I was able to progress further on this although did not get any help on this forum.

    1.What I am doing it writing my strategy in Amibroker.
    2.I have a front end application to Login and get Accesstoken, Login can't be done from AmiBroker since it's a single threaded application hence you need a Desktop/Web App to login once per day.
    3.Once you login using your desktop app write the access code in memory of your machine or in some file.
    4. Create a Amibroker Plug-in. In my case I have used VB.Net to create Amibroker Plug-in DLL.
    5. This Plug-in will have all execution methods like Buy, Sell, Use the Accesstoken received from your Desktop application and set that as Accesstoken for this plug-in.
    6. Once Aminbroker signal is received call the PlaceOrder Method of the Amibroker Plug-in inside Amibroker
    7. Amibroker Plug-in works as the Logical Layer between AmiBroker and Kite APIs that @rktheinvestor1 has mentioned in his post above.

    I am still working on it but it's on the right path so if you follow this approach it should work.
  • rktheinvestor1
    @Ganesh
    Great.
    I am also able to get the automation flow working using java now.
    Getting limited because of java clients not being completely supporting BO order modification.
  • sujith
    Hi @rktheinvestor1,
    You can modify bracket order in java client.
  • rktheinvestor1
    @sujith

    Yeah i got to know but things are not clear because of documentation not really helping. For example

    Documentation says ...Order id of order being modified - for bo is it order id of parent or SL-M dont know..

    /**
    * Modifies an open order.
    *
    * @param params
    * params.exchange - Exchange in which instrument is listed (NSE, BSE, NFO, BFO, CDS, MCX).
    * params.tradingsymbol - Tradingsymbol of the instrument (ex. RELIANCE, INFY).
    * params.transaction_type - Transaction type (BUY or SELL).
    * params.quantity - Order quantity
    * params.price - Order Price
    * params.product - Product code (NRML, MIS, CNC).
    * params.order_type - Order type (NRML, SL, SL-M, MARKET).
    * params.validity - Order validity (DAY, IOC).
    * params.disclosed_quantity - Disclosed quantity
    * params.trigger_price - Trigger price
    * @param variety variety="regular". Order variety can be bo, co, amo, regular.
    * @param orderId order id of the order being modified.
    * @return Order object contains only orderId
    */
    public Order modifyOrder(String orderId, Map params, String variety) throws KiteException, JSONException {
    String url = routes.get("orders.modify").replace(":variety", variety).replace(":order_id", orderId);
    JSONObject jsonObject = new KiteRequest().putRequest(url, authorize(params));
    Order order = new Order();
    order.parseOrderPlacedResponse(jsonObject);
    return order;
    }
  • sujith
    You have to send order_id and parent_order_id for modifying second leg order.
    We will update javakiteconnect docs about bracket and cover order also.
  • tarunsuneja
    Hello @Ganesh , can you share sample code of VB .Net plugin? I also want to implement something similar
  • sujith
    @tarunsuneja,
    Check out java example here. You will have to pass same params.
  • tarunsuneja
    @sujith , thanks, I'm interested to know how this will be called from ami broker when a buy / sell is triggered?
  • bhumit
    can anyone willing to give solution for Amibroker? I m ready to pay for the work.
  • kuvi
    how to send real time data (from kite quote / websocket) to amibroker
  • RA9243
    @Ganesh could you share the vb.net amibroker plugin. I am facing difficulty in it.
Sign In or Register to comment.