Categories: Zerodha

Zerodha Pi Scanner Code Examples (TradeScript Codes)

Zerodha provides a trading software named Zerodha Pi to the clients who wish to trade through it. Though Zerodha has other web trading platform Kite, Pi is preferred by many because of the unique advantages which are inbuilt into the software. The most attractive feature Pi comes with is the scanner. The scanner runs on simple programming code popularly known as Zerodha Pi scanner code or the TradeScript code. There is a big array of codes in the archive for simple or complex strategies to be employed for the scanner or autotrade.

Zerodha Pi scanner is a powerful tool for intraday traders as well. Today we are going to discuss few codes written in TradeScript (programming language employed by Zerodha for scanner and autotrade). These Zerodha Pi scanner code or TradeScript codes will come to immense help to the traders. Using these codes one can instantly know which stock is performing the way one would like it to or which stock is preparing for the next move. The only prerequisite for using these codes is the basic knowledge of technical analysis.

tradescript codes1. Moving Average Crossover – It is a popular method of determining the trend.  SMA or a simple moving average of closing prices of two different time frames are compared to get an overview of the price trend. The code is as follows.

SET MA1 = SimpleMovingAverage(Close, 28)

SET MA2 = SimpleMovingAverage(Close, 14)

CROSSOVER(MA2, MA1) = TRUE. In this code, the scanner will notify when the shorter moving average of any stock price in any time frame crosses over the longer moving average indicating a bullish crossover/ trend. The opposite code i.e. CROSSOVER(MA1, MA2) = TRUE will denote the opposite trend. Otherwise speaking if one buys a stock at bullish crossover signal, the opposing signal defines the time for exit and vice versa.  MA parameter can be of one’s own choice.

2. MACD (moving average convergence divergence) – MACD shows potential overbought/ oversold condition. The Zerodha Pi scanner code or Tradescript codes for MACD is;

Long Cycle: 26
Short Cycle: 13
Signal Periods: 9
MA Type: SIMPLE (recommended parameters)
Code –
SET A = MACDSignal(13, 26, 9, SIMPLE)
SET B = MACD(13, 26, 9, SIMPLE)
CROSSOVER(A, B) = TRUE. The signal holds true MACD crosses signal line indicating a bullish crossover.

3. Stochastic Oscillator – This indicator has two components, %K & %D. A simple rule is to buy when oscillator rises above 80 0r %K>%D and sell when it falls below 20 or %K<%D.

% K Periods: 9
% K Slowing Periods: 3
% D Periods: 9
MA Type: SIMPLE (recommended parameters)
Example
SOPK(9, 3, 9, SIMPLE) > 80 OR SOPD(9, 3, 9, SIMPLE) > 80.

There are many effective Zerodha Pi scanner code or TradeScript codes which are beneficial to traders. Kindly visit our Zerodha Pi scanner page for more efficient use of the scanner.

Share
Tags: algos and strategies for zerodha pi pi scanner code tradescript codes zerodha pi scanner code

View Comments

  • I am not able to use variables in the scanner. Also it seems to be taking only single line code instructions. Whenever I try setting variables like using "Set" or multiline instruction it gives an error.

    Not sure if that's the correct behavior

    regards
    soumendra

Recent Posts

Wonder Fibromats IPO Review, Issue Details, Analysis
  • IPO Review

Wonder Fibromats IPO Review, Issue Details, Analysis

Wonder Fibromats Limited is engaged in manufacturing, supplying, designing of motors, home appliances, energy-efficient fans, and allied equipment. This is…

3 days ago
Budget Day Trading Strategy With Line Break Chart
  • Trading Strategy
  • Zerodha

Budget Day Trading Strategy With Line Break Chart

This is a re-written version of my post of 2017. I thought that republishing my old post can give you…

2 weeks ago
Using Forex Mean Reversion Indicator In Intraday Trading
  • Forex

Using Forex Mean Reversion Indicator In Intraday Trading

Introductory details to forex Mean reversion indicator: Many traders, even those with expertise use systems to increase the probability of…

3 weeks ago
MCX Holidays 2019 List Details, Timings
  • News

MCX Holidays 2019 List Details, Timings

The year 2018 has come to an end. So, it's the time to be prepared for the coming new year.…

3 weeks ago
Option Greeks – Great Tools To Trade Options
  • Trading Strategy

Option Greeks – Great Tools To Trade Options

Option pricing model gave us some tools which were named as option greeks. They are derived from the options pricing…

3 weeks ago
SK International Export IPO Review, issue details, price
  • IPO Review

SK International Export IPO Review, issue details, price

SK International Export Limited is mainly a manufacturer and exporter of beachwear and scarves. This is mainly a Mumbai based…

3 weeks ago