Zerodha Pi To Excel To Build An Excel Trading System

Connect Zerodha Pi To Excel

A few days back I have written How To Create Intraday Trading Excel Sheet From Sharekhan TradeTiger? That post has got a very good response from my readers and I have got many requests from my Zerodha clients for posting to know how on creating a similar excel trading system connecting Zerodha Pi to excel. If you dont have Zerodha Pi, you can apply for a Zerodha account by clicking HERE.

Steps involved in connecting Zerodha Pi to Excel

First, log in to your Zerodha Pi terminal. Once Pi is logged in open the Nifty50 all scrips market watch by clicking File –> Predefined WorkSpace –> NSE –> Nifty 50. It will load all Nifty50 stocks in your MarketWatch.

Zerodha Pi Open Marketwatch

My Nifty50 MW (my given name for this MarketWatch) is open. Now the MarketWatch needs to be sorted by symbol name. So please click on the Trading Symbol column header to sort it alphabetically.

Zerodha Pi MarketWatch

Now right-click on the market watch and click LINK TO EXCEL (Ctrl+E). This will connect Zerodha Pi to excel and save the market watch data in an excel sheet to the location \Zerodha\Pi\LinkExcel\Nifty50 MW.xlsx.

Zerodha Pi Link To Excel

If you have already saved excel in that location, for second-time use or recurring use, it will ask you to replace the excel file.

Zerodha Pi Replace Link To Excel

Now the excel file will automatically open. It will contain only 1 sheet called Nifty50 MW (the same name as MarketWatch). In case the market is open, the live price will start changing in excel.


Creating a trading system on Excel after connecting Zerodha Pi to Excel

Now we will create another sheet and write formulas there. Let’s work on the same formula Open High Low Same Trading Strategy For Indian Stock Market. To build our excel trading system let’s create 2 columns in sheet2 called Open=Low and Open=High.

The formula for Open=Low column 2nd row is:
=IF(‘Nifty50 MW’!H2=’Nifty50 MW’!J2,”BUY”,””)


The formula for Open=High column 2nd row is:
=IF(‘Nifty50 MW’!H2=’Nifty50 MW’!I2,”SELL”,””)


Now select row A2 and hold the extreme right bottom corner of the cell and drag below through the entire column. It will copy the formula in the rows below. Repeat the step for the B2 column too. Check the image below:


So in the excel trading system, now we get BUY or SELL scrips. Today (2nd March 2017), I have got AMBUJACEM, COALINDIA, AND ULTRACEMCO as BUY and got DRREDDY, GRASIM, INDUSINDBK, NTPC, and POWERGRID as selling.

Setting a target and stop-loss

Setting a target and stop loss in the Excel Trading System:

I have added a 2.5% target and set up a stop loss 2 ticks below the day’s low for BUY and 2 ticks above the day’s high for day low. I will round the targets and stop loss to 2 decimal places by formatting the excel cells as shown below. Finally, I have decorated the sheet a bit and renamed Sheet2 as Trade.

So we have completed creating an excel day trading spreadsheet by connecting Zerodha Pi to excel. If you are unable to connect Zerodha Pi to excel yourself, you can download my excel sheet from here.

Link To Excel Zerodha Pi

Now after you downloaded my excel file from above just save it to your /Zerodha/Pi/LinkExcel folder.

l levels instantly. Check this youtube video for the whole process of data import:

You can use this excel sheet for creating other buy/sell logics too. Your comments below this post can take this discussion to further heights.

Conclusion and Latest Update

Though this was a nice way to get live data from Zerodha Pi to Excel, Zerodha does not support Pi anymore. Hence, this process does not work now. However, traders can use Python and Pycharm to populate live stock market data into Excel.

Author: Indrajit Mukherjee

Indrajit is a professional blogger and trading system developer. Amibroker expert, Wordpress expert, SEO expert and stock market analyst.Trading since 2002, he has started the journey of on 2008. He follows Indian and world stock markets closely.

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
Avinash J.R.

Thanks a million for the email regarding excel sheet i’ll try it out.I request you to do some research regarding Darvas box which is there in Pi chart settings.

Kaushal Mehta

Hello Indrajit,
How can we keep the Trading calls generated from the open=low/open=high system constant till the end of the day in excel sheet?

Rajam Ananthakrishnan

Hi Indrajit, can you help in creating a strategy based on Supertrend for scanner on Pi?


Hello, Good Work –

Anup Gogoi

Sir can you please make same excel fo BANKNIFTY also.

Anup Gogoi


Chandra Mohan Baloni

can we place order from excel itself

Chandra Mohan

Thanks Indrajit for quick reply. can you please help in writing buy sell code for open=low and for open=high. thanks again

Jyotirmay Patel

Brilliant……Excellent tricks in details. Thank you.

Soumendra Mishra

Sir I am using Excel 2016 32bit & my OS is Windows 10 but I am not able connect Pi to Excel only I am getting (NA)

Soumendra Mishra

Yes sir one is Default and other is Nifty 50 but when I am connecting the excel file opening automatically with the marketwatch name and the content is NA

Soumendra Mishra

Sir for amibroker (above mentioned link) the excel file is generated in exported folder this is fine but from LinkExcel file the price is not coming all the cells are marked .NA. Is there any extra configuration required ?


same here. Did you find a solution?


Is it possible to export data from excel sheet back to Zerodha PI ?


Hi Indrajit,

Thanks for such a detailed description.

I would like to get the buy/sell signals created in Zerodha Pi Expert Advisor into MsExcel.

Could you please let me know how to do it.


Craig Albuquerque

can we save hourly Data in separate Sheet ?…from input, live intraday Data (From Pi).

Pradeep U

Hello sir,

Thank you for this wonderful post but i have a small problem which time frames high or low you prefer i.e. we came to know if open and high of first candle is same the we should sell and vice versa for buy but problem is which time frames candle we have to choose.

And one more information is i want to export data from pi to excel but i want only 1st 15min candles data how to restrict this sir?

Thank you in advance.

Pradeep U

i am trying to link excel but i get all NA values how to resolve this please help me

Dr. Anurag Singhal

Wonderful Indrajit.
Exactly what I was looking for.

Kehal Pola

Can you make a excel sheet that scan stocks that going up with increase volume and going down with increase volume ?


Excel file is showing NA values. MArketwatch name is same although. Pl guide


showing NA after linking, name is same as market watch . location is also same.


I am also getting the same error. Can you please guide?

SH Pande

I am at Pune, your representative is available at PUNE? at present my DEMAT with sharekhan portfolio 8lakhs

Ratan Kumar

I was looking for something like that and found very awesome.
However, I was trying to figure out the formula to get the high and low of first 15 minutes or opening range.
Can you please help me to get that.

mayank aggarwal

Sir when linking to excel…only NA coming… file name same.. location same as u guided still NA price or script showing…… is this the problem of excel bits?? 32 bit or 64 bit excel sheet is required for this purpose?? Plzz help

Mihir Thakkar

how to get weekly data from pi to excel?…like weekly hig,low open


I installed 32 bit Excel 2016…still showing error.. please help if you have other solution

max shafi

Not able to link excel. Every time i link excel and it opens, then closes on its own. Some HRESULT error shows up. Kindly help.


Hi, Mr. Indrajit,
Nice n intersting thread.
Is it possible to import data from Scanner tabs to Excel?


ive saved on same name but still i get NA in all colums, im using 64bit win10


He INDRAJIT, awesome 🙂


what should be entry point

Would love your thoughts, please comment.x