Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Amibroker – Auto Trading Control for NEST/NOW Terminal

1 min read

This is the updation of Manual Trade Control for NEST/NOW. This afl have new features like it will have all the trades in its memory. This AFL is not a strategy for trading. It can be used only for integrating the Amibroker to pass orders to NEST/NOW Trading Terminal through NEST PLUS API.

Nifty Auto Trade

 
AFL Code Written Buy : Ranjith K R
AFL Creator Email ID : ranjicgnr@gmail.com

Features

1. You can predefine your quantity of Buy/Sell in the parameters
2. You Can Enter your Client ID in the Parameters
3. You can select the Buy/Sell Price from Ask price, Bid price or LTP.
4. Option for Enabling Actual Trading (If Disabled, No Signals will go to NOW/NEST, But chart will generate signals.) This can be used for testing.
5. Selecting the Buy/Sell as Intraday or Delivery.
6. Selecting Order Type as Limit/ market
7. Short/Cover is included. You can add strategy and manual trade also is possible.
8. It saves all Buy/Sell & Short/Cover trades in memory and plotted until its cleared.
9. Option for selecting type of trade. ie Long,Short or Together. Long trade will only starts with a buy signal and Short Trade will Only start with Short Signal. Sell and Cover signals will only appear after buy and short signals.
10. Separate display for Buy, Sell, Short and Cover Traders for clarity.
11. KeyBoard Shortcut for Buttons.
Buy → Numpad 7
Sell → Numpad 8
Short → Numpad 4
Cover → Numpad 5
Clear → Numpad 0

Amibroker AFL Code

https://gist.github.com/bcceee7e23c8d2e67748

You have to replace the existing buy/sell strategy with your buy/sell strategy. Strictly do not use the buy/sell strategy in this afl for real trading.. Replace the following coding in the above AFL with your own Trading System

https://gist.github.com/179bc05fe0bd151f2b37

Requirements

1. For Buy/Sell Price selection, use Aux1 and Aux2 for importing the Ask Bid Prices.
2. Symbol in the Amibroker should be the same as present in the NEST/NOW.
3. Active Nest Plus API Subscription is required (Contact your broker for NEST PLUS API subscription)
4. NEST/NOW trader should be opened and logged in. Also logged in to the NEST PLUS with a valid API subscription.

Usage
1. Copy The Afl to Custom Afl folder of amibroker.
2. OPEN AFL IN FORMULA EDITED AND DELETE STRATEGY PORTION OF CODE AND TYPE PASTE YOUR BUY/SELL STRATEGY IN THAT PLACE AND SAVE THE AFL.
2. Drag and drop the afl to an intraday chart blank chart.
3. Enable Controls and Strategy and Autotrade options.
4. Select type of trades you want (Long/Short)
5. Select Buy Price, Sell Price, Product Type and Order Type
6. Enter Client ID and LotQty.

Press Buy/Sell/Short/Cover buttons for manual trading.
Strategy based signals will come automatically.

Note: Only Buy and Short will happen first. You cannot do a Sell or Cover in first. Only Two BUY or SELL or SHORT or COVER one after another are not possible.
Note: Don’t use this afl for backtesting your strategy. BackTest your strategy separately and paste it in this afl.

[Suggest Features For Improvement. This Afl is tested with amibroker 5.7 and 5.9 veraions] [NEST, NOW, Amibroker are registered products of the Respective Companies]

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

What is QuantZilla?

Quantzilla is 75+ hours of code mentoring program designed for noncoders who want to learn the coding program right from designing indicators, scanners, trading...
Rajandran R
58 sec read

Things to Consider While Building a Bracket Order Execution…

Building a Bracket Order Strategy is the most demanded request we got from most of the algomojo traders. This article explains the list of...
Rajandran R
12 min read

PlaceOrder – Multi Broker Exectuion Code Snippets for Amibroker

This tutorial explains how to build a button trading right from scratch and with a click of a button how you can send orders...
Rajandran R
7 min read

30 Replies to “Amibroker – Auto Trading Control for NEST/NOW Terminal”

    1. Sir, please let me know if it is possible. Or please point me to any document which provides codes. The document on Omnesys site only provides for Normal Orders.

      Thanks

      1. To my knowledge for Retail Traders only Limit Orders are supported in Nest/Now. And only a dealers using dealers terminal can do Market Orders, Order Modification which is restricted as of now in common retail traders terminals due to Exchange and SEBI compliance.

  1. sir i am using now terminal only. i dont have nest or nest plus. is it working now terminal? pls reply.

    1. I dont have any idea about that. If they are providing full autotrading to retail traders without NSE approval then probably it could be a illegal product.

      1. dear raj,

        how to write in afl, BUY at signal price AT CL basis of Candle stick of 5 Min with order type “lIMIT” , becoz my order will be generated on the base of particular signal of an indicator, i m not going with order type MARKET, due to slippage factor, my holding will be basically more than 30 mins to 2 hrs.

        plz advise………………

  2. i have a strategy which works fine on 2 min candlestick closing price.
    if the price is moved above the 0.8% of opening price of the first 2 min candle stick then buy and target being 1.6% of the opening price of the first candle stick. If it reaches then exit else continue.
    StopLoss being Opening price.

    ex : opening price of 1st candle stick is 100 at 9:16 and at 9:18 or whenever the price reaches 100.8 i will buy and selling it when the price reaches to 101.6
    StopLoss is being if price moves below 100

    1. How can you coded this?
    2. how to check the status of the trade executed ?

  3. Dear Mr. Rajandran,
    I’m having a very little knowledge on AmiBroker and Chart Analysis. But i’d like to go for Semi-automated AlgoTrading with Amibroker. So, Can you help me with a most effective and accurate Buy/Sell signal generating AFL which will work on AlgoTrading with Amibroker. And what is the role of NEST Plus in Algo, what does it do??

    If you want to share/discuss anything in private feel free to drop a mail at your convenience on the above mentioned email-id.

  4. If I try to use this afl alog with sort of supertrend, its not working, I mean it is not generating signals..
    The code is Buy = trend==1; where trend is derived as from supertrend indicator.Pls help…

  5. Hi,
    Anyone got this working for NFO kindly post the modified code. Keep getting error ‘COM object variable is not initialized or has invalid type(valid COM object handle is required)’. Using Trial ami 5.9, and GDFl datafeed , Tried reinstallation of ami, as suggested by someone else in the forum with no luck. Strangely the GDFL plugin works fine.
    Thanks in advance

  6. IS this settings working in Nestnow terminal, I mean have anyone tested this with some live AFL. I just need confirmation so as I may subscribe to nestnow API and test also

  7. Does anyone recently got NEST Plus activated for NSE Now Terminal? I am trading using NSE NOW terminal from Zerodha and not able to get NEST Plus activation.

    Do you suggest any alternate API?

  8. Dear Team,

    I didn’t understand below mentioned lines…can you please explain me same in easy language. so i can understand.

    Note: Only Buy and Short will happen first. You cannot do a Sell or Cover in first. Only Two BUY or SELL or SHORT or COVER one after another are not possible.

  9. how to set trading time
    eg.from 9.30am to 3.00 pm
    here can u provide those code so that i can set trading time also

Leave a Reply to Namrata Cancel reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More