Basics

Following are the indicators that you can use in algoZ to not just study and analyze price data, but also act on them:

Accumulative Swing Index

Aroon

Aroon Oscillator

Bollinger Bands

Chaikin Money Flow

Chaikin Volatility

Chande Momentum Oscillator

Commodity Channel Index

Comparative RSI

Detrended Price Oscillator

Directional Movement System

Ease of Movement

Exponential Moving Average

Fractal Chaos Bands

Fractal Chaos Oscillator

High Minus Low

High/ Low Bands

Historical Volatility

Linear Regression Forecast

Linear Regression Intercept

Linear Regression R-Squared

Linear Regression Slope

MACD

MACD Histogram

Mass Index

Median Price

Momentum Oscillator

Money Flow Index

Moving Average Envelope

Negative Volume Index

On Balance Volume

Parabolic SAR

Performance Index

Positive Volume Index

Price Oscillator

Price ROC

Price Volume Trend

Prime Number Bands

Prime Number Oscillator

Rainbow Oscillator

Relative Strength Index

Simple Moving Average

Standard Deviation

Stochastic Momentum Index

Stochastic Oscillator

Swing Index

Time Series Moving Average

Trade Volume Index

Triangular Moving Average

TRIX

True Range

Typical Price

Ultimate Oscillator

Variable Moving Average

Vertical Horizontal Filter

VIDYA Moving Average

Volume Oscillator

Volume ROC

Weighted Close

Weighted Moving Average

Welles Wilder Smoothing

Williams %R

Williams Accumulation Distribution

Write your own Strategy (Scripts)

Using algoZ, you can create your own strategies using technical indicators discussed above, for buying/selling an instrument. To write your own strategy, Right-click on any chart → Select “Scripts” → Select “Add New Script.

The algoZ screen inside the NEST terminal

A strategy can be written with four expressions:

Buy Script Expression – to define when a long (buy) position should be taken for a scrip.

Sell Script Expression – to define when a short (sell) position should be taken for a scrip.

Buy Exit Script Expression – to define when to exit a long (buy) position by selling that position.

Sell Exit Script Expression – to define when to exit a short (sell) position by buying that position.

Writing and editing strategy expressions

This can be done either by entering the strategy using the edit boxes provided or by using the “Make Expression” function.

Creating expressions with built in vectors and functions

Select the required parameters for Vector/Period/Indicator and click on “Update LHS” to update the left-hand side of the final equation. Select a math function and the desired parameters to complete the expression by clicking on Update RHS.

In case you do not wish to set a condition for all expressions, you would have to type in 0 in the edit boxes for those expressions. Only the expression for which you set any condition would generate orders, provided that condition is met. Save your template by entering any name in the Saved Templates option and click on Save. You’re now ready to backtest, go live or edit your strategy.

Back-testing

Back-testing helps you to analyze his strategy and test it out by applying it on historical data before going live with it. If you are not satisfied with the outcome as indicated by the backtest for a particular strategy, you can modify the expression for that strategy and backtest it again until the results appear satisfactory.

To back-test a strategy, right-clickon the chart, click on Scripts, select the script name that you want to back-test and click on Backtest.

Backtesting a strategy

It will indicate buy/ sell signals generated (if any) for that script in the chart window. An upward green arrow indicates a Buy signal, while a downward red arrow indicates a Sell signal.

Backtesting results visualized

The user can also view comprehensive details of the Back Test, by right-clicking on the Intraday Chart and selecting ‘Back Test Details’. The Back Test Details window, as illustrated below, provides details with respect to the outcome of the strategy entered, evaluated on historical data. Corresponding to the user’s parameters getting triggered the action is taken and profit/ loss calculated, which the user can use as a reference to check whether the back-test was successful, or he would like to use a different methodology.

Backtest analysis results

The Backtest Analysis Info section provides details such as the Total number of trades, number of profitable and loss-making trades, largest profit/ loss, net profit/ loss and so on to better help in analysing the applicability of a strategy.

Going Live with your Strategy (Live Script)

“Going live with your strategy” means that whenever your condition as set in the Buy, Sell, Buy Exit, Sell Exit expressions is met, corresponding orders will start getting placed in the Live Market.

In case you’re using algoZ with an Investor Client login, you will be prompted to confirm the order, every time a condition is triggered. Unless you confirm the order to get placed, it will not.

In case you’re using ZT Dealer with a Dealer login, you have the option to select whether the orders are to be placed automatically, or you should be prompted to confirm the order before placing. This is explained further below.

To take your strategy to the live market, right-click on the chart, click on Scripts, select the scrip which you want to go live with, and click on Live.

Taking a Strategy Live

You then need to fill in your order details and set order preferences.

Setting Alert Preferences

Execution Period can be set to define the Start Time and End Time during which the orders should get placed. Product Type would help to select the product type that has been enabled, similar to placing of normal buy/ sell orders (F1/ F2).

‘Begin With’ field has three options: Any, Buy and Sell. If ‘Any’ is selected, the algo will simply place a buy or sell order, depending on whichever condition gets satisfied first. If ‘Buy’ is selected, the first order that the algo places will by a buy order. That means even if the sell condition gets satisfied, the system will not generate an order until the buy condition gets satisfied. The reverse is for sell.

Product Type field is the same as the normal buy/ sell order entry window. You can select MIS for Intraday or NRML for carry-forward positions in Derivatives or CNC for Delivery-based trades in Equity (in this case, care should be taken to avoid short sell).

Set Interval tells the system at what chart interval the strategy should be evaluated and orders placed. This is configurable, with a base interval of 1 minute.

You need to define the quantity to be placed per opportunity that is whenever a condition is met.

Order Type can be set as Limit/ Market/ Stop Loss as per preference. In case of selecting a Limit order, you can decide a pre-defined limit or let the limit price be determined based on the signal price, which is when the buy/ sell signal was given.

For placing limit orders based on signal price, tick on the check-box “Place from Signal Price”. Select whether the price should be picked as the ‘Close’, ‘Open’, ‘High’ or ‘Low’ for the interval during which signal was given by selecting the option from the ‘Pick’ drop-down option.

You can also provide an offset that needs to be added to (in case of buy orders) or subtracted from (in case of sell orders) the signal price.

Evaluate as tick is used in conjunction with Set Interval. If the check box for evaluate as tick is checked, the strategy will be evaluated at every tick with the calculation based on the interval entered in Set Interval field. In effect, evaluate as tick tells the system to place orders, even in between the candle based on the strategy, instead of at the close of the candle.

Stop Loss Order trigger price allows the user to enter a trigger percentage for a stop loss order to be sent with the Buy or Sell orders generated by the strategy. This works similar to a cover order.

The dealer can also place orders for the strategy, with the same parameters, for multiple accounts mapped to him. In case of trading for multiple accounts, you can save an account list, by clicking on ‘Save’ and Load this list anytime while going live with any strategy.

Once you click on ‘Submit’, signals will be generated with an alert to act on them whenever the condition specified in the Script is met with.

Controlling a Live Script

You can view details for all scripts that you have gone live with, by clicking on Pulse Running Scripts under the Nest Plus menu. Alternatively, you can right-click on the chart and select ‘Show Running Scripts’. All the scripts that are in ‘Live’ mode will appear as illustrated below:

Viewing the scripts you’ve gone live with your strategy

From this window, you can pause/ resume a script, place manual buy/ sell/ square off orders, view reports for all orders placed along with total number of trades, largest profit/ loss, net profit/ loss and so on.

To stop a script, right-click on the ‘Running Scripts’ window, and click on ‘Maximized Mode’ to exit maximized mode. You will be able to view an option to stop the strategy. Click on it to pause an active script, and to resume a paused script.

Stopping a live sript

You can also place orders manually overriding the script, by clicking on the Buy or Sell options provided next to the Stop option. In case, you click on Buy, it will get replaced by the Exit option. Similarly, if you click on Sell, it will get replaced by the Exit option to exit any positions taken manually.

Placing orders manually

To view details of action taken, right-click on the Running Scripts window and click on ‘Open Report’.

Viewing action report

All orders placed in this manner will be visible in the Order Book (F3 window).

Viewing orders in the orderbook

You can distinguish orders placed through algoZ from other orders from the ‘Remarks’ column in the Order Book. All Order Book features such as modification, cancellation, order history and so on are applicable to orders placed through algoZ as well.

79 comments

Dear Sir/Madam,
I want to write strategy, but I am not able to fit my startegy in this algo. Anybody please let me know how to write this.
1) I want to buy when closing of the candle is higher than highes of previous 9 candles & sell when closing of candle is lower than lows of previous 9 candles. This will be in hourly TF.
2) Secondly buy will be only when the trend is uptrend confirmed by cross-over of 8 & 34 EMA in hourly TF. Sell will be vice-versa.
3) In this system , exit from buy will be when candle closes below the lows of previous 9 candles with closing price below 8 EMA and exit from sell will be when candle closes above highes of previous 9 candles with closing price below 8 EMA.
Please let me know how to write this strategy?

Hi one small suggestion it would be nice if you could put all this in a audio and video format bcoz as beginner its difficult for me to understand all this I feel it would be easy to understand if its in a audio and video format.

Could u please help me to code this strategy.
I want stock screener with this conditions.
Buy alert when price is within 1% range above the daily Super trend
Sell alert when price is within 1% range below Super trend indicator.

I am very much new to this automated stuff. So kindly bare with me if the question is way too basic.

1. I am not able to add the Nifty to watchlist in the ZT

The Strategy I want to implement:

On day chart on MACD Crossover: whenever a buy signal is generated I want to buy/sell Nifty options strike which is nearest to the current Nifty. Then have 10 rupees trailing SL on previous days OPEN/CLOSE.

I want this scrip to run everyday.

Apart from this I observed there are few more options in the trade window such as bracket, trailing ticks etc etc.

It is strange that this query was not replied. I only got this working and also found the same issue. I had also posted the same question in one of the blogs. So far no one from zerodha has answered it. Perhaps it is due to the Navaratri holidays. But I find that recently lot many queries on these forums / blog are unanswered by zerodha team.

I think this is basic utility provided by Omnesys to get the traders buy their advanced custom made scripts. Those are the ones they build internally with all the function capabilities.

The present utility is crude and half baked. The concept of separate script for Buy and Sell itself may not be a not a very good idea. This means you have identify which script you want activate for a given scrip probably based on its trend (up or down). Which means if the scrip reverses the trend on a single day you will have to change the script.

In any case, unless the multiple conditions are considered, there is no point in wasting any time on this.

I had some problem with my Chart and Strategy back testing etc. I have called your office and the person attended (one Mr. Sunil ) has made it working very well. Thanks for the support. Keep it up. Lijoo

My friend and I both trade together on the same account, basically we manage the same strategy and trades together, when I am busy he works on it and when he is busy i do it. Totally we manage to monitor our trades throughout the day.

Issue is that he logs in from his home and i have to log in from my home to the same account at the same time which gives an error message now if one person has already logged in. Is there a way we both can login to the same account at the same time?

Also I want to ask is it possible to place Cover order in AlgoZ???
I have tried placing Cover order, but it gives error.
If not then, will it be possible to place cover order in the new platform with you are going to launch???

Pi is our new in house trading platform, but this is a desktop version and we still don’t have a mobile for this. But if you use PI/ZT for desktop, we have mobile apps for both IOS and Android. If you send an email to [email protected], they will migrate you from NOW to ZT/Pi.

Sandeep, our tech vendor Omnesys/reuters have stopped supporting algoZ/pulse. We are about to launch our in house application Pi, which has much more advanced backtesting/scripting tools. We are launching the final beta next week. Check this https://www.youtube.com/watch?v=Pd66QOQwykQ

Hi Sir ,
I just want to know that currently the back testing of strategy is available for only past 60 days data? and if not, then , what i should do if i want to back test my strategy for more than 60 days , and also i want to see the back test result on charts also.

Hello Nithin, How can I as a user be sure about user confidentiality? How can I rest assured that my winning strategies when executed on your platform will not be sold by Zerodha to any of Hedge Funds etc for monetary compensation?

Also kindly provide contractural details in your customer on-boarding form which mention the customer confidentiality

Dear Sir/Madam,
I would like to code break-out strategy based on Fractal Chaos Band.

Please help to me to code the following rules for back test in PI
1) When high of the candle touches upper band then buy on next Candle if it crosses previous high & Sell exit if there is open sell order
2) When low of the candle touches lower band then sell on next Candle if it crosses previous low & Buy exit if there is open buy order

Make sure the version you are using is latest by selecting About Zerodha Pi under Help menu, it should be dated 18/11/2016, If not uninstall this version and install again from back office Q.
One can double click on any drawing to edit it, if still facing any issue one can write to [email protected].

Before scanning the above criteria mentioned it should check if %K line has crossed %D line below minus 40. When this criteria matches and when the %K line is above plus 30 on a 10 minute chart it should signal a BUY.