17 February 2017

Automation of the Windows Terminal of NSE NOW

Disclaimer:
  1. Try this at your own risk.
  1. If you do decide to use this, Test  it thoroughly before you do so.
  2. At the time of writing, the NSE NOW version is : 1.13.3.5
  1. This has been tested by me  only for the above mentioned version for the NSE NOW software provided by my broker Finvasia.
  1. This has been tested on  Win 10 64 bit OS
  1. The automation script is designed for day trading on the NSE CASH segment

Acknowledgement:
This brilliant article from Stocksonfire set me thinking. Its perfectly suited for those of us who like to trade on the FnO segment  for a fixed lot size.  Although limited in its functionality, X-Mouse Button Control is a good choice for this.
But what if I need to trade on the NSE Cash segment with a clear cut position sizing and a dynamic Stop Loss ? Therein lay the origin of this script written in AutoIt.  Some of the other tools that I have explored for this automation are SikuliX, Selenium and AutoHotkey


Purpose of this Automation:
  1. Create a Hotkey for placing a Buy/Sell order. Here (Shift + B) is used for placing a Buy Order. And (Shift + S) is used to place a Sell Order
  2. Automatically place a SL (either SL-Limit Order or a SL-Market Order) along with each Buy/Sell Order.  The default is  SL-Limit Order.
  3. For a Long position, the Low of the day is taken as Stop Loss . For a Short position, the High of the day is taken as SL.
  1. A rudimentary Position Sizing .  For the input trading capital , the number of shares to Buy/Sell are determined by the formulae: (ltp - stoploss)*noofshares = risk per trade. For finer details on position sizing, check with the writings of GuruJi Van Tharp