Features

Features

The rest of the documentation will delve deeper into each feature described here.

Broker Connection

Charanna Vypari uses a Broker's Trading & Historical Data API. Vyapari does not have any details about the broker on installation and you must provide the required API & Secret Keys. Once configured, you will be able to log into Vyapari the same way you log into your Broker's trading terminal.

Vyapari is designed to support multiple Brokers. At this time Definedge Securities is fully supported. Zerodha, Fyers and other Brokers will be integrated in future releases.

Stock Exchange

Vyapari is aware of the major Indian Stock Indexes - NSE, BSE & MCX. Of these, NSE is fully supported for live trading. BSE & MCX will be fully integrated in future releases.

Concepts

We must discuss a few terms and concepts you will encounter in the world of Charanna Vyapari. They are common terms but we must clearly understand how they are used and how they behave in the context of Charanna Vyapari.

Instruments & Watchlists

Vyapari referes to any instrument tradeable via your Broker as an Instrument. Collections of Instruments are called Watchlists and these are used extensively in Scanners & the Quant Engine. Each Instrument is unique to a Stock Exchange and has a number of characteristics which will be detailed in the section on Instruments. Chief among them is the Exchange, which represents the Stock Exchange in which that Instrument is traded.

Chart Types

At the most basic level, we receive OHLCV, or Open, High, Low, Close & Volume, data from the Stock Exchange via the Broker. These are then converted into different representations for use in Charting and Trading. The most commonly used Chart Type is of course the Candle Stick. Well, the Bar Type is similar and not considered separately by Vypari. Other Chart Types include Renko, Hieken-Ashi, Point & Figure, Kagi, etc.

Vyapari fully supports Candle Stick & Renko chart types. Hieken-Ashi, Point & Figure and Kagi will be supported in future releases.

Time Frame

Vyapari uses the term Time Frame to denote a period of time. The lowest Time Frame supported is TICK and the highest is YEAR. In between we have the other Intraday Time Frames like 1 MINUTE, 3 MINUTES, 5 MINUTES, 15 MINUTES, etc., and the higher Time Frames - DAY, WEEK, MONTH, QUARTER and YEAR. Time Frames are used when defining a Bar Series (see below) and creating Scanners (see below). Strategies are Time Frame neutral be design though in certain circumstances they can or must be Time Frame dependent. More on that in the Strategies section.

Bars & BarSeries

A Bar represents a single OHLCV Data Point for an Instrument. A BarSeries is a series of Bars at a certain Time Frame for an Instrument. The BarSeries is the basis of all work done by Vyapari. When you create a Strategy and Scanner that uses 5 Minutes data, you are dealing with a BarSeries at 5 Minute Time Frame for each of the Instruments you are working with. For example, 5 Minute Bar Series for NIFTY 50 means there will be 50 different Bar Series, one each for each of the NIFTY 50 Instruments.

The user rarely has to deal with Bars and Bar Series but it is critical that you understand them in order to understand how the Quant Engine, the Strategies and Scanners behave. In fact, proper Strategy Design and Construction will require an instinctive understanding of these concepts. More on that in the individual sections.

Vyapari uses the Broker's API to listen to TICKs from the Stock Exchange, one for each trade executed at the exchange. It uses this stream of data to build a live Bar Series, as Candle Sticks or Renko Bricks, for each Instrument being tracked. The Quant Engine uses these Bar Series at runtime to place trades.

Indicators

Vypari supports more than 100 Technical Indicators. We will go into detail about each supported Indicator in later sections. The most important point to keep in mind with respect to Indicators in Vypari is that they are all very flexible and can be combined together easily. For example, it is straight forward to apply a Bollinger Band Indicator on another Indicator like the Relative Strength Indicator. Such indicator composition is native to Vypari and available out of the box - without the need to write any code.

Rules & Strategies

Vyapari supports a large collection of Rules. These are constructs that are used to build a Strategy. For example, we have Rules like AND, OR and XOR. We use them to combine different conditions into a Strategy, Like (RULE-1 OR RULE-2) AND (RULE-3 OR RULE-4).

Each of these conditions (RULE-1, RULE-2, etc.) uses another set of Rules to describe a condition to be tested. For example, Over, Under, Greater Than or Equal To, Less Than or Equal To, In Slope, Is Rising, Is Falling, NOT, etc. These Rules will produce a TRUE or FALSE result when evaluated. For example, EMA (20) OVER EMA (50) will be TRUE when EMA (20) is greater than EMA (50) - Over It.

A collection of Rules combined with AND, OR & XOR creates a Strategy.

NOTE: In Charanna Vyapari, a Strategy is a Rule Too! That means user defined Strategies can be used where a Rule can be used, allowing for complex chaining of conditions and no limits on the number of conditions that can be tested in a single Strategy.

Multi Time Frame Scanners

Vyapari has two types of Scanners, both multi time frame capable. Scanners operate on a Watchlist of Instruments, refered to as its Universe.

  • Basic Multi Time Frame Scanner and
  • Indexed Multi Time Frame Scanner

Both types of scanners can contain one ore more Strategies at different Time Frames. For example, you can have a Scanner that has 3 Strategies, one operating on 3 Minute, the second on 60 Minute and the third on Day. The Scanner will "qualify" when all 3 strategies return true, meaning your strategy conditions are met on all 3 time frames.

The Indexed Muti Time Frame Scanners go a step further and introduce an Index with it's own set of Strategies. The Index can be any Instrument. Such a Scanner will Qualify when it's base Strategies qualify and the Index Strategies also Qualify. Take for example a scanner that uses NIFTY as the Index and NIFTY as the Universe. Here, we will get a trigger when one of the Instruments in NIFTY qualifies and NIFTY (as the Scanner Index) also qualifies.

Capital & Risk Management, aka., Robot Traders

In the world of Trading, the Strategy is only 15% of the equation that leads to success. The biggest chunk, 50%, is Trading Psychocology and the other big chunk is Capital & Risk Management.

That said, it must be understood that Trading Psychocology is heavily dependent on Capital & Risk Management for the two Asuras of the Trading World - Fear & Greed - are closely linked to them. Why would you, the Trader, fear Fear when you know that your Capital is well managed and your Risk exposure at any point of time is within the parameters you have set?

Vyapari helps you manage your Capital & Risk and thereby your Trading Psych, that balance where you are comfortable with your financial position and can look at the market with equanimity.

Robot Traders are entities in Vyapari that collect all this into a single unit of data which is then used by the Quant Engine to determine what it can and cannot do - constraint it. For example, what percentage of your available capital can be risked in a single trade? How many concurrent open positions can you have? What is the maximum risk you are willing to take in a single trade and hence during a day? All these parameters are used by the Quant Engine to determine your Position Size when entering a Trade. Vyapari uses the Capital Exposure process for position sizing using the information in the Robot Trader being used to drive the Quant Engine. More on that in the Robot Trader section.

Back & Forward Testing

Back Testing is a key feature of Vyapari. A dedicated Quant Engine is used with Historical Bar Series data, Candle Sticks or Renko, to simulate Live Trading and generate detailed reports. The back testing engine allows you to test over different time periods, restricted only the data that is available. See the Back Testing cahpter for more details.

Forward Testing uses the Vyapari Quant Engine with a special type of Broker called the Paper Trader to simulate trading during market hours. In effect, forward testing behaves exactly as the Quant Engine would behave in real life minus the use of real money to place trades. This gives you, the Trader using Vyapari, a tremendous edge over all others by allowing you to study the behavior of your Trading Plan (Strategy + Capital & Risk Management) in real life without taking the risk of deploying your capital.

Back Test + Forward Test to get a clear idea of how your Trading Plan is likely to perform.

Quant Engine

The heart of Vyapari!

We will go into details of how the Quant Engine works in the chapter dedicated to it. Sufice to say that the Quant Engine is a intelligent beast that takes care of the following:

  • Scans the live market against a set of Entry Strategies for an Universe of Instruments
  • When an Instrument's Price Action triggers a valid entry, the engine takes the following actions in series:
    • Compute the Capital Allocation based on the Robot Trader settings
    • The Stop Loss to use
    • Hence the Position Size
    • The optional Target to use (as configured in the Robot Trader)
    • Creates the required Trailing Stop Loss, aka, Exit Scanner,
    • Places Entry Order
    • Updates the Open Position count so that the Robot Trader's setting of Max Concurrent Open Positions is not violated by subsequent Entry Signals
    • Start scanning for Stop Loss, Target & Trailing Stop Loss
    • Continue scanning for entry signals in all instruments in the Universe in use
  • When any of the exit scanners qualify (Stop Loss, Target or Trailing Stop Loss), the Quant Engine will initiate it's Exit Position process
    • Place an Exit Order
    • Update Open Positions, releasing the Open Position slot for reuse in case of other entry signals
    • Stop all the Exit Scanners for this Instrument (Stop Loss, Target or Trailing Stop Loss)
  • This process executes continously through the trading day - Entry -> Scanning for Exit -> Exit.
  • The Quant Engine will Square Off any and all Open Positions at the exact instance of time configured in the Robot Trader as the Square Off Time, for example 15:10 in the case of NSE (user configurable).

The Quant Engine can also be configured, via Robot Trader, to honor allowed Trade Entry Time Slots. For example, only enter trades on or after 9:30 and do not enter new trades after 14:30.

At the end of trading, when all positions have been squared off and the Quant Engine stops execution, it generates CSV files with all the data generated during the day - Scan Events, Orders placed, Positions and Capital Allocation details. This data can be used after hours to cross check the work done by the Quant Engine.

Inspectors

Data Inspectors are a critical part of Vypari as they allow the trader to closely examine the data that the Quant Engine is generating and consuming. That gives you, the Trader, deep insight into the behavior of your strategies and scanners. It also allows you to generate and study different types of data. For example, the Indicator Inspector will generate data for any set of Indicators and instruments that you select. Imagine the insights you can gain by stuying the raw OHLCV and Indicator data for the entire NIFTY 50 or other list of Instruments at different tme frames, starting at 1 Minute all the way to Year! You could generate this data from Vypari and feed it to a ML Algo for example. Or pull it into Excel and study it. Or use KNIME or similar tool for very detailed analysis of price and price derivative behavior over time.

You are no longer in the Guessing Game!

You can Verify each and every data point. Nothing is hidden behind a proprietory software like TradingView. Charanna Vypari generates and provides any data you might wish to examine.

Now that is Real Power!

Charting

Vypari provides web based Charting leveraging TradingView's APIs. The functionality available is limited at this time but sufficient to visualize the data being used by Quant Engine.

Note: There will always be differences in OHLCV Data from different sources. For example, Definedge, and hence Vypari, data might not exactly match what you will see in TradingView, Fyers, Zerodha or other platforms. This is because of various factors bnut primarily because of how the data provider handles the data. None of them are wrong, even when they do not match up to the 2nd decimal point.

Other Tools

A number of other tools are available in Vypari:

  • Market Watch
    • The market watch displays live market updates during trading hours. You can have more than one Market Watch open a the same time.
  • Watchlist Manager
    • Used to manage Watchlists, collections of Tradeable Instruments. You can modify existing WatchLists, Create new Ones, Export Watchlists to CSV and Import Instruments from CSV into a Watchlist.
  • Realtime Scanner
    • Realtime Scanners can be run during trading hours to monitor Scanner behavior. They generate Scanner Signals and log them in the UI but do not fire any orders.