Day Trading Stocks & Futures

nac

Well-Known Member
Hi Guys!!!

Do anyone have/know any tool for calculating turnover tradewise - FIFO method?

Zerodha is giving trade wise turnover report, pretty much every other broker only giving contract wise net position report. I have been doing this manually for some years now. I tried several times googling over the last few years to see if there is any tool/excel sheet. Though I have found some, but not much of a use. Only one was close to what I was looking, but that's not a perfect one and the calculations weren't right. Since I don't know VBA, not a lot I could do with that file.

Recently I pulled that file from archive and tried to find some solution, but couldn't understand much.

I am uploading that file, if anyone know VBA and can fix it, that would be helpful for us. Excel related forums is not much of a help in this regard. I have tried few times over the years but no response. I guess it's too complex.

Errors I could spot in the file.
- Even though, both purchase and sale qty is equal, excel throwing error saying sell qty is higher than buy qty
(in fact, it would be better if there is a qty difference on one side, code should assume the price is 0 for that qty and calculate. That includes even if there is no exit from the position i.e, only long/short entry and no exit - - sell/cover) - So this means the calculation for totaling qty is wrong.
- If we use only one ticker, it wouldn't through error but exclude the excess qty if it's in the sell side. If in buy buy side, it would show as unsold qty.
I have tried lot of things. So the data in Purchase and Sales worksheet (where we put our data) you see is not the original, that's something I entered to check.

I don't know what else are wrong in this file. But the one who made this did some good job.

PS: This file is downloaded few years ago from online when googling. No idea about who made this file or from where exactly I downloaded this file.
 

Attachments

ncube

Well-Known Member
I received a PM to know about Algo Trading, I am sharing my reply here as I feel it will help others who are interested in Algo/systematic trading:

There are multiple ways to learn Algo/Systematic trading (Not HFT) and it depends on your skill sets. Based on your technical/programming experience you can consider the option that you feel comfortable from below:

1. Use behavioral anomalies to design strategies:
1. Books by Andreas Cleanow:
(Comes from Hedge fund background and writing style is good to understand the concepts)
1. Equity : Stocks on the Move (Momentum based strategy)
2. Futures: Following the trend (Trend following strategy)
3. Tools: Trading Evolved (This is his latest book and explain setting up a full fledged systematic trading platform along with multiple strategies)
2. Python based back-testers: I prefer python, there are other back testers available such as LEAN, Tradingview etc
1. backtrader : I had been using this for long time but its getting complex and planning to move to zipline (used by Quantopian and explained in Trading Evolved)
2. bt: This is a simple python back-testing tool and learning curve is low, but limited features.
3. Zipline: Full fledged back-tester and now can be adapted to Indian data also, so I am planing to use this in future.

2. Using statistical anomalies to design strategies:
1. Books:

1. Building Algorithmic Trading Systems - Kevin Davey
2. Systematic Trading - Robert Carver
3. Quantopian Lecture series.
2. Tools: Kevin using excel and trade station for back-testing, Also any tools like amibroker, or python back-testers can be used.

3. Manual systematic trading:
1. Books:

1. Trade like a stock market wizard - Mark Minerveni
2. Think & trade like a champion - Mark Minerveni
3. Many other trading related books and our own Traderji Forum...:)
2. Tools: Back-testing need to be done manually using excel or preferred tools, and based on trading time frame the back-testing period selected: Daily FT min 7-10yrs, Intraday: 3-5yrs

A note of caution: Algo trading does not ensure steady returns, from 2018 till date the returns are break even or negative for most of the systems. In fact I am in net red due to missing few trades at times. Hence you may have to consider different trading styles, like include multiple non-correlated strategies, trade intraday with edge or regular job to ensure alternative revenue streams.

One important factor I consider is the return on efforts/stress. I am fine with lower returns if I have peace of mind, hence first our expectations should be clear. Systematic trading based on Daily/Weekly/Monthly can give returns in the range of 15-30% Annualized in the long run, however in any given year it can range between -25 to +150%.

Finally it all boils down to higher risk higher rewards, so one need to give importance to the drawdown one is comfortable, if the strategy gives higher returns but has higher drawdowns then everyone will not have the ability to stick to it. This is one of the main reasons many intra day traders fail as intra-day trading give higher returns with the advantage of higher leverage, but they cannot accept the drawdowns that come along with it and quit at a time when the strategy is actually at the corner of turnaround..:)

I prefer the 1st option, but have also done 2nd and 3rd options mentioned above. I am comfortable with lower drawdowns...lower risk lower rewards..but it will ensure better returns than mutual funds in the long run...and my mind is less stressful...:)
 
Last edited:
I received a PM to know about Algo Trading, I am sharing my reply here as I feel it will help others who are interested in Algo/systematic trading:

There are multiple ways to learn Algo/Systematic trading (Not HFT) and it depends on your skill sets. Based on your technical/programming experience you can consider the option that you feel comfortable from below:

1. Use behavioral anomalies to design strategies:
1. Books by Andreas Cleanow:
(Comes from Hedge fund background and writing style is good to understand the concepts)
1. Equity : Stocks on the Move (Momentum based strategy)
2. Futures: Following the trend (Trend following strategy)
3. Tools: Trading Evolved (This is his latest book and explain setting up a full fledged systematic trading platform along with multiple strategies)
2. Python based back-testers: I prefer python, there are other back testers available such as LEAN, Tradingview etc
1. backtester : I had been using this for long time but its getting complex and planning to move to zipline (used by Quantopian and explained in Trading Evolved)
2. bt: This is a simple python back-testing tool and learning curve is low, but limited features.
3. Zipline: Full fledged back-tester and now can be adapted to Indian data also, so I am planing to use this in future.

2. Using statistical anomalies to design strategies:
1. Books:

1. Building Algorithmic Trading Systems - Kevin Davey
2. Systematic Trading - Robert Carver
3. Quantopian Lecture series.
2. Tools: Kevin using excel and trade station for back-testing, Also any tools like amibroker, or python back-testers can be used.

3. Manual systematic trading:
1. Books:

1. Trade like a stock market wizard - Mark Minerveni
2. Think & trade like a champion - Mark Minerveni
3. Many other trading related books and our own Traderji Forum...:)
2. Tools: Back-testing need to be done manually using excel or preferred tools, and based on trading time frame the back-testing period selected: Daily FT min 7-10yrs, Intraday: 3-5yrs

A note of caution: Algo trading does not ensure steady returns, from 2018 till date the returns are break even or negative for most of the systems. In fact I am in net red due to missing few trades on times. Hence you may have to consider different trading styles, like include multiple non-correlated strategies, trade intraday with edge or regular job to ensure alternative revenue streams.

One important factor I consider is the return on efforts/stress. I am fine with lower returns if I have peace of mind, hence first our expectations should be clear. Systematic trading based on Daily/Weekly/Monthly can give returns in the range of 15-30% Annualized in the long run, however in any given year it can range between -25 to +150%.

Finally it all boils down to higher risk higher rewards, so one need to give importance to the drawdown one is comfortable, if the strategy gives higher returns but has higher drawdowns then everyone will not have the ability to stick to it. This is one of the main reasons many intra day traders fail as intra-day trading give higher returns with the advantage of higher leverage, but they cannot accept the drawdowns that come along with it and quit at a time when the strategy is actually at the corner of turnaround..:)

I prefer the 1st option, but have also done 2nd and 3rd options mentioned above. I am comfortable with lower drawdowns...lower risk lower rewards..but it will ensure better returns than mutual funds in the long run...and my mind is less stressful...:)
Firstly let them please do an exhaustive backtest
 

bpr

Well-Known Member
I received a PM to know about Algo Trading, I am sharing my reply here as I feel it will help others who are interested in Algo/systematic trading:

There are multiple ways to learn Algo/Systematic trading (Not HFT) and it depends on your skill sets. Based on your technical/programming experience you can consider the option that you feel comfortable from below:

1. Use behavioral anomalies to design strategies:
1. Books by Andreas Cleanow:
(Comes from Hedge fund background and writing style is good to understand the concepts)
1. Equity : Stocks on the Move (Momentum based strategy)
2. Futures: Following the trend (Trend following strategy)
3. Tools: Trading Evolved (This is his latest book and explain setting up a full fledged systematic trading platform along with multiple strategies)
2. Python based back-testers: I prefer python, there are other back testers available such as LEAN, Tradingview etc
1. backtester : I had been using this for long time but its getting complex and planning to move to zipline (used by Quantopian and explained in Trading Evolved)
2. bt: This is a simple python back-testing tool and learning curve is low, but limited features.
3. Zipline: Full fledged back-tester and now can be adapted to Indian data also, so I am planing to use this in future.

2. Using statistical anomalies to design strategies:
1. Books:

1. Building Algorithmic Trading Systems - Kevin Davey
2. Systematic Trading - Robert Carver
3. Quantopian Lecture series.
2. Tools: Kevin using excel and trade station for back-testing, Also any tools like amibroker, or python back-testers can be used.

3. Manual systematic trading:
1. Books:

1. Trade like a stock market wizard - Mark Minerveni
2. Think & trade like a champion - Mark Minerveni
3. Many other trading related books and our own Traderji Forum...:)
2. Tools: Back-testing need to be done manually using excel or preferred tools, and based on trading time frame the back-testing period selected: Daily FT min 7-10yrs, Intraday: 3-5yrs

A note of caution: Algo trading does not ensure steady returns, from 2018 till date the returns are break even or negative for most of the systems. In fact I am in net red due to missing few trades at times. Hence you may have to consider different trading styles, like include multiple non-correlated strategies, trade intraday with edge or regular job to ensure alternative revenue streams.

One important factor I consider is the return on efforts/stress. I am fine with lower returns if I have peace of mind, hence first our expectations should be clear. Systematic trading based on Daily/Weekly/Monthly can give returns in the range of 15-30% Annualized in the long run, however in any given year it can range between -25 to +150%.

Finally it all boils down to higher risk higher rewards, so one need to give importance to the drawdown one is comfortable, if the strategy gives higher returns but has higher drawdowns then everyone will not have the ability to stick to it. This is one of the main reasons many intra day traders fail as intra-day trading give higher returns with the advantage of higher leverage, but they cannot accept the drawdowns that come along with it and quit at a time when the strategy is actually at the corner of turnaround..:)

I prefer the 1st option, but have also done 2nd and 3rd options mentioned above. I am comfortable with lower drawdowns...lower risk lower rewards..but it will ensure better returns than mutual funds in the long run...and my mind is less stressful...:)
have u considered backtrader instaed of zipline
https://www.backtrader.com/
 
Last edited:

ncube

Well-Known Member
TRAI has asked for consultation

have u considered backtrader instaed of zipline
https://www.backtrader.com/
Ah, my mistake, I typed it as backtester, instead of backtrader in my previous post...corrected it there. Thanks.

Backtrader is developed in pure python and easier to install compared to zipline and has good documentation. One can choose any backtester as it is just a tool. One need not even use any tools, can just do the backtesting of systematic rules manually on excel and referring to chart. Being consistent in our execution of trades and making our strategies mechanical is more important. I prefer python based tools as it easily allows me to plug in machine learning models and I like the flexibility of extending the functionality when I require.

However one key difference is that backtrader allows for live trading and one can connect to the broker platform easily. Zipline currently do not provide this support. Since I use EOD data any backtesting tool is ok with me, I find backtrader & zipline both to be excellent open source tools. I have also used bt for some of my strategies as it is quite intuitive. I am just exploring zipline but finding that it has lot of dependencies and hardcoded values, hence if one is not good in python programming he may find it a little difficult.

BTW, all open source tools have a steep learning curve, hence one should select which they are comfortable with, even commercial tools like Amibroker, trade station etc are fine. Objective of backtesting should be to use it as a tool to test our strategies faster and not end up debugging the tool itself...:). In my post I just shared the guideline on learning Algo trading based on my own journey, this will just help cut down on your learning time but will not make you profitable from day one. Its a long process...and will take its own time..:)

I keep reading new books, explore new tools and ideas regularly whenever I have time...like these days I am bit free...as it helps to keep me occupied and not to focus on tweaking my current strategies and lose discipline....instead my focus is on new ideas..:)
 
Last edited:
Does anyone know how to copy read only shared folder in google drive. A read only folder has been shared. I want to create a copy of that folder and keep it it my google drive so that in future if the readonly folder is deleted by its owner I will still have my copy in my drive. any one has any idea? Thanks
Can anyone please help me on this?
 

Similar threads