Trade with Ajeet Singh

Free stuff for trading

Webinar 13 DEC 2020 | Lesson #18



 

How to spot swings in Forex


To be applied only on Forex
but you are free to apply on any scrip
Gives best result on Hourly Time frame.


Link to Top Indicator

Link to Bottom Indicator


- Enjoy Trading



Peak Margin Circular from Sebi

 


What is the Peak margin circular about
SEBI has been grappling with some issues in recent years amongst which were of course broker corruption, network effects of one failure on others, and then there was the severe discomfort with the extremely high percentage of derivatives turnover versus cash.

Because of the way derivatives are- a synthetic instrument, it has attracted not only strategy based players but also heavy speculation by retail investors. To control this, SEBI has been increasingly raising margins and the size of the contracts but this effort was neutralized as brokers gave ever increasing multipliers to counter it. In effect , raising risk to their balance sheets in an era of decreasing brokerage and sources of funding.

By its peak margining circular, SEBI has effectively capped the exposure that’s possible in derivatives – to 4x of margin in Phase 1 (Goes down to 1x of margin by Sep 1, 2021) – and that’s where the effects will be felt as that’s where more than 90% of the turnover is.

On the other hand, while the same 4x principle applies to cash as well, its possible that volumes from derivatives –for stocks and especially better quality stocks like Reliance where margins in cash are lower than in derivatives –  will move to the cash segment and provide some kind of balance to overall turnover. Which is probably what SEBI wants.

No surprise then that it rolled back some of the increased margins on non FNO stocks so that leverage returns to the cash market – beyond FNO stocks- and in turn there is increased activity in a larger spectrum than just the derivatives markets. Of course, by nature index derivatives will offer high multipliers (Even at full margin applied you get to buy almost 6x value of an index so why ask for more?) so that’s where derivative trading may continue. Random speculation on options may come down as multipliers reduce but then, that’s by design. Also what may happen is that option writers start looking at farther contracts or more out of money contracts to earn/save on margins thus possibly bringing liquidity into these sections of the market. Which is good.

SEBI’s mind is clear – by nature, the margin system provides leverage. For Rs 25, you can buy Rs 100 worth of a stock in derivatives and carry it for many days.  This means you are leveraged anyways. So why have additional leverage on top of that. Example, a 10x leverage on margin means you could buy Rs 100 worth of Reliance for just Rs 2.5 (10% of Rs 25)-  a big risk in derivatives as the contract could go either way till expiry!

Overall, it seems like a well considered move and the semi final before the one final hassle / difference between cash and derivatives is removed – T+1 settlement. That , combined with further decrease in cash margins may be what SEBI is targeting next.


So how will the peak margin system work?
In concept its very simple.  So far the exchanges never knew (remember that they work with members on upfront and peak margins anyway- it’s the extension to the client that was the issue) what the broker allowed clients to do intraday as measurement of obligation versus client margins was on an end of day basis. This meant that brokers could, to wean away volumes , offer higher and higher multipliers intraday and create risk for the entire system if something went wrong– across the chain of the clearing member, the exchange and in certain situations, other clients as well. To cut this effect, and ensure that the member allows clients to trade only with their own money, they had to know what was the maximum margin intraday utilized for any specific client versus the actual margin.

The peak margin attempts to do that – it tries to estimate the maximum intraday margin used by a client and compares to his actual margin available – to identify if the broker gave additional limits. And if the broker did, then he has to prove it was his money and not someone else’s.  because someone elses money means risk of one default can still spread to other innocent parties.

But then that means brokers would take risk and put more capital behind speculation – so the next step? Reduce intraday to clients own capital! This is what will happen by next September.


The Calculations
The calculations are fairly simple – lets say you had Rs 100 in your account today – beginning of day – and you used lets say Rs 500 as margin (In cash it would mean VAR+ELM and in derivatives, Initial Margin) to buy Rs 2000 worth of a derivative – some of which you did intraday and some you took delivery. Lets say you retained Rs 90 with the broker at end of day and your end of the day margin obligation for this derivative is Rs 80.

From December 2020, for such a trade, the formula would run something like this : The exchange would consider the higher of the two calculations below as your shortfall:

  • 25% of your peak margin of Rs 500= Rs 125 was required but you had only Rs 100 during the day. So shortfall of Rs 25
  • EOD margin of Rs 80 was required but you had Rs 90 at the end of the day DESPITE the cash withdrawal. So there is no shortfall as per the EOD formula. This is how it has worked so far.
  • Higher of the two? Rs 25! So even if you had no obligation at end of day and you had fully paid for the position and the broker graciously returned Rs 10 to you at end of day because he was covered, there would be a shortfall! And a penalty!

So how would the broker cover this risk? He would not allow you in the above example to have more than Rs 400 (4x of 100) of margin leverage in Phase 1 – because then there cant be a shortfall as per 1 above.  It was the extra Rs 100 that created the Rs 25 shortfall!  And by September 2021, the client would be required to have Rs 400 if he wishes to utilize Rs 400 of peak margin. Remember that even then, the leverage stays at 4x-5x as margins are 20%. So no big damage!

The second problem – how would the exchange communicate to the broker various peak margins of various clients – no such technology linkages exist today between the CPs and brokers. So the exchanges would do a random pick of snapshots – 4 times a day- and pick out the maximum of the 4 for each client!  Remember its random so you cant fool the system J

There are further complications around this – meaning the peak margin sticks to the client till T+2 days in the cash segment – and till the trade is settled, the peak margin will continue to reduce leverage for T+1 and T+2 days as well!

- Copied from Internet

How to choose stocks for Next Day





I have received numerous queries on how to choose stocks for next day

 As you all know that I use super trend for trading intraday  and it is based on small swings or pullbacks.

 So first step to narrow down stocks for the next day is to check its beta in 3 minutes chart with index.  Now beta is the movement of a stock with respect to index . I not only check its movement with respect to index but I also check how its wings with respect to the index.  Our system is based on swings so for me, the beta is, how the stocks swings with respect to index. In this way I narrow down 20 stocks out of 125 stocks in my list. I never trade stocks less than rupees 80 and higher than rupees 15000.

 Second step is to shortlist 6 stocks out of these 20 stocks. For this I start scrolling big Facebook groups and telegram groups. From 3:30 p.m. To 7:30 p.m.,I run a program  that scans, the stocks about which, traders are talking a lot. Reason can be anything, direction can be anyway but  I simply scan the stocks in which other traders or retailers are interested in.  In my backtesting I have seen that such stocks definitely show some movement next day.  So finally I make a list in which the most talked stock is at top and the least at bottom .  Hence we get 6 stocks for next day, intraday trading using supertrend.

(I have written this post using speech to text software so there may be some grammatical errors)

-Ajeet Singh 

A perfect setup for Entry

 


Upper Indicator SuperTrend

Lower Indicator, Vol + Trend

 Hello friends

 I received number of requests,  on how to draw the setup

First of all I am mentioning two links for the indicators the first link is for super trend indicator and the second link is for volatility and trend indicator

 I have attached herewith a sample image for a perfect setup

 so here are the few points that you have to consider before entering into a trade. Timeframe of chart, will be always 3 mins


1.  First of all I will look for signal in supertrend, for a buy there must be up signal and for sell it must be a down signal in supertrend.

2.  Then we will look for pullback.  Signal which is after a pull back is more reliable than others

3.  Now we will search a basic pattern of price action that is double top for sell and double bottom for a buy.  The more, price tested a level, the more it's better. Like instead of double bottom double top if you find triple bottom for triple top it is much better

4. Then we will move to a lower indicator and look for a volatility. Lesser the volatility, better is the signal. It is denoted by Black bars on the top line of the table so while taking the trade, if there is a black bar in the lower indicator, on that candle, the signal is more reliable

5.  The rest of the two lines denotes that Trend.  Lower line denotes the trend in 15 minutes and Middle line denotes the trend in five minutes. So while taking a bullish trade at least 1 line must be blue among these two lines and for a bearish trade one line must be Orange among these two

6.  We have to take a entry only after completion of the running candle. Like whenever a signal is generated in supertrend, we will wait for the candle to close and as soon as the candle closes we will enter a limit price for the close price of the signal candle. I personally never entered on market price

7.  Target will be always 1% from the entry level. If we buy at 500 then the target will be 505 and if we sell at 500 target will be 495

8.  At any point of the trade we can never control the result but quantity is always in our control suppose you trade with 1 lakh rupees, then quantity for a 500 rupees share will be 200. I term it as 100 percent quantity. But suppose one condition is missing or you are bullish on index and got a bullish signal but volatility black box is missing then we will enter with reduced quantity like 70% or 80%
 or if a pullback is missing  we can go with 80% quantity so lesser the conditions are met lesson the quantity will be

9.  Now to make the quantity higher I will check the support and resistance lines as well. Suppose after all the conditions met, a pullback is formed exactly on the support then  we can slightly higher the quantity of trade or a doji is formed at pull back then also we can increase the quantity.

10. so you start with a simple setup and then keep on adding different parameters as you feel confident.  Normally I try to post charts based on my personal trades, you keep tracking them this will help to clear your doubts.

11.  Whenever I do a change in any of the integrator, I changed its version and will be updated at tradingview website. so whenever you find a change of version in my screenshots then remove the indicator from your favorites and add it again. Links for the indicators will remain same

(I have written this post by speech to text software so there may be some grammatical errors)

-Ajeet Singh

SuperTrend with VWAP


 

VWAP , a widely used indicator
In the free account, there is a limit to add max. of 3 indicators
and with my 2 indicators added, the very scope is left to add further studies
I received many requests to add this indi in my setup, although I personally don't use the same
So here's the new version of ST with vwap
Enjoy


Click HERE to add indicator to your chart







A Better CCI


This is an oscillator, better than CCI
and to be used with Supertrend
It is meant of scalping in running trend
suppose the price is below superT and oscillator touches 100 and returns
then we can initiate a short for few bucks and vice versa for buy
Point to note is.... Oscillator must not be above 100 or below -100
for more than 1 candle, it must just touch and returned.
I tested it on 3 mins timeframe and gave good returns.
Indicator is 100% Non-Repainting but for candle to close...
and gives best results on 3 mins timeframe


Click HERE to add an indicator to your chart







 

Volatility Trend Indicator


 

Color bands show you broader trend
For buy setup look for blue and for sell setup look for orange
Black line shows volatility
as we want to reduce SL so while entering any setup
volatilty line must be less than 100


Click HERE to add an indicator to your chart






Superb gains with SuperTrend

Highly efficient supertrend indicator
follow me on telegram to get daily 4 stocks
which fits in this supertrend for a profit of 1% daily
Stocks are shared daily on telegram:
https://t.me/magictrend









Time Based Trend Reversal by Thanos

 


https://in.tradingview.com/script/SxcQdQaJ-Time-based-zone-PP-Fibo-PP-TOT/

Squeezed Price - Next Day Breakout

 


https://chartink.com/screener/squeezed-price

Scan Narrow CPR for Next day

 



https://chartink.com/screener/narrow-cpr-for-next-day-5

How to trade SuperTrend



 

Volatility Detector





This indicator is used for detecting Volatility
To be applied only on 15 mins chart
As soon as you spot a circle (Inc. in Volatility ) then high movement is
expected in further 5-6 candles
Movement can be up or down
Its can be best used for scalping...
Run a chart on 15 mins, detect a candle with an indication of high movement ahead
shift to smaller timeframe like 3 mins
apply lower setting supertrend like 11,2
and take benefit of the move

Helping books on Amibroker












Magic Trend

Magic Trend
( Signals are Less but accuracy is More )



Breakouts - Good way to Earn




Nest To AmiBroker Data Feeder


Nest to AmiBroker Data Feeder is a utility which facilitates to transfer data from NEST Trading Terminal to Amibroker. Which provides RealTime and Backfill data to Amibroker from Nest Trading Terminal, it supports NSE equity, NSE futures and Option, MCX, Currency Market (CDS), and also BSE Exchanges.

Nest to AmiBroker Data Feeder takes Real Time data from Nest Terminal using RTD feature of Nest Terminal and it provides Backfill from Nest Plus Data table, also provides google Backfill for NSE equity stocks. 


Silent Features of Nest to Amibroker data Feeder


  • Updates RealTime Tick data to Amibroker.
  • Updates data for all the available symbols in the watchlist
  • User can backfill data using Nest Plus data table.
  • Google backfill facility available for NSE equity stocks. 
  • User can Map the watchlist symbols as he required.
  • Works On booth 32 and 64 bit operating system.
  • Easy to navigate the application.
  • Supports NSE equity, NSE futures and Option, MCX, Currency Market (CDS), and also BSE Exchanges.
Installation:
  • You need registered amibroker so that your data is saved after you exit the application
  • Download and install, Latest Java from HERE.
  • Download and install, Microsoft Dot net 4.5 from HERE.
  • Download and Install, Nest 3.12 or later from your broker.
  • Download and Install, Nest Plus for Backfill (provided Free by broker)
    (Dont ask me for Nest Plus as I won't provide free of cost)
  • Download and Install, Nest to Amibroker from HERE.
  • Nest must be running prior to utility and all Softwares must be running in admin mode.
  • But if everything is installed correctly then it will work perfectly



Backfill too is easy through Nest Plus


  • There is NO limit on no. of scrips but software will pick only active watchlist so
    if you have limit of 50 scrips in a watchlist then same limit will be on datafeed.

Download:  FREE for Personal Use


Trending Stocks for Today






Here's a simple scanner in chartink,
to scan for trending stocks daily
You can use any strategy to trade intraday in these stocks






Effective EMA Trading System




Phython Code to fetch OI data for FnO


Output Files
1) combined_ce_and_pe_open_int.csv
2) combined_future_open_int.csv
3) price_change.csv

Libraries
import requests, zipfile, StringIO
import sys
import argparse
import os
import convertCSVToXLSX as csvtoxlsx


Variables to declare
month_dict = {
"01": "JAN",
"02": "FEB",
"03": "MAR",
"04": "APR",
"05": "MAY",
"06": "JUN",
"07": "JUL",
"08": "AUG",
"09": "SEP",
"10": "OCT",
"11": "NOV",
"12": "DEC"
}
future_index_stock = [
'FUTIDX',
'FUTSTK',
]
instrument = 'OPTSTK'


Download Bhavcopy from NSE website
def download_bhavcopy(formated_date):
url = "https://www1.nseindia.com/content/historical/DERIVATIVES/{0}/{1}/fo{2}{1}{0}bhav.csv.zip".format(
formated_date.split('-')[2],
month_dict[formated_date.split('-')[1]],
formated_date.split('-')[0])
r = requests.get(url, stream=True)
if r.status_code == 404:
print "No data found for date {0}".format(formated_date)
return
z = zipfile.ZipFile(StringIO.StringIO(r.content))
z.extractall()
file_name = z.filelist[0].filename
# print file_name
return file_name


Parse arguments to be passed from command prompt or in eclipse argument
configuration
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--compare", help = "This compare the data", dest = "hostname", required = True)



Get OI change
def get_option_oi_change(current_date_file, previous_date_file):
filtered_current_date_file = {}
filtered_privious_date_file = {}
if not current_date_file or not os.path.isfile(current_date_file):
return
if not previous_date_file or not os.path.isfile(previous_date_file):
return
with open(current_date_file, 'r') as f:
for line in f:
if line.split(',')[0] == instrument:
symbol = line.split(',')[1]
OPTION_TYP = line.split(',')[4]
open_int = line.split(',')[12]
if symbol in filtered_current_date_file:
filtered_current_date_file[symbol].append(
"{},{},{}".format(symbol, open_int, OPTION_TYP))
else:
filtered_current_date_file[symbol] = ["{},{},{}".format(symbol, open_int, OPTION_TYP)]
with open(previous_date_file, 'r') as f:
for line in f:
if line.split(',')[0] == instrument:
symbol = line.split(',')[1]
OPTION_TYP = line.split(',')[4]
open_int = line.split(',')[12]
if symbol in filtered_privious_date_file:
filtered_privious_date_file[symbol].append(
"{},{},{}".format(symbol, open_int, OPTION_TYP))
else:
filtered_privious_date_file[symbol] = ["{},{},{}".format(symbol, open_int, OPTION_TYP)]
# print filtered_privious_date_file
with open('combined_ce_and_pe_open_int.csv', 'a') as f:
s1 = "{},{},{},{},{},{},{}".format("symbol".upper(),
"ce_privious".upper(),
"ce_current".upper(),
"ce_percentage_change".upper(),
"pe_privious".upper(),
"pe_current".upper(),
"pe_percentage_change".upper(),
f.write(s1+"\n")
for symbol, list_of_line in filtered_privious_date_file.items():
combined_ce_privious_open_int = 0
for v in list_of_line:
if 'CE' == v.split(',')[2]:
if '.' in v.split(',')[1]:
privious_ce_open_int = float(v.split(',')[1])
else:
try:
privious_ce_open_int = int(v.split(',')[1])
except ValueError:
print v.split(',')[1]
privious_ce_open_int = 0
combined_ce_privious_open_int = combined_ce_privious_open_int + privious_ce_open_int
# print combined_ce_privious_open_int
combined_pe_privious_open_int = 0
for v in list_of_line:
if 'PE' == v.split(',')[2]:
if '.' in v.split(',')[1]:
privious_pe_open_int = float(v.split(',')[1])
else:
try:
privious_pe_open_int = int(v.split(',')[1])
except ValueError:
print v.split(',')[1]
privious_pe_open_int = 0
combined_pe_privious_open_int = combined_pe_privious_open_int + privious_pe_open_int
combined_ce_current_open_int = 0
for v in filtered_current_date_file[symbol]:
if 'CE' == v.split(',')[2]:
if '.' in v.split(',')[1]:
current_pe_open_int = float(v.split(',')[1])
else:
try:
current_pe_open_int = int(v.split(',')[1])
except ValueError:
print v.split(',')[1]
current_pe_open_int = 0
combined_ce_current_open_int = combined_ce_current_open_int + current_pe_open_int
combined_pe_current_open_int = 0
for v in filtered_current_date_file[symbol]:
if 'PE' == v.split(',')[2]:
if '.' in v.split(',')[1]:
current_pe_open_int = float(v.split(',')[1])
else:
try:
current_pe_open_int = int(v.split(',')[1])
except ValueError:
print v.split(',')[1]
current_pe_open_int = 0
combined_pe_current_open_int = combined_pe_current_open_int + current_pe_open_int
try:
combined_pe_current_open_int_percentage_change =
((combined_ce_current_open_int/(combined_ce_privious_open_int*1.0) - 1)*100)
except (ZeroDivisionError):
combined_pe_current_open_int_percentage_change = "NA"
try:
combined_ce_current_open_int_percentage_change =
((combined_pe_current_open_int/(combined_pe_privious_open_int*1.0) - 1)*100)
except (ZeroDivisionError):
combined_ce_current_open_int_percentage_change = "NA"
# with open('combined_ce_open_int.csv', 'a') as f:
# s1 = "{},{},{},{}".format(symbol, combined_ce_privious_open_int, combined_ce_current_open_int,
combined_pe_current_open_int_percentage_change)
# f.write(s+"\n")
with open('combined_ce_and_pe_open_int.csv', 'a') as f:
s1 = "{},{},{},{},{},{},{}".format(symbol,
combined_ce_privious_open_int,
combined_ce_current_open_int,
combined_pe_current_open_int_percentage_change,
combined_pe_privious_open_int,
combined_pe_current_open_int,
combined_ce_current_open_int_percentage_change)
f.write(s1+"\n")


Get Futures OI
def get_future_oi_change(current_date_file, previous_date_file):
filtered_current_date_file = {}
filtered_privious_date_file = {}
with open('combined_future_open_int.csv', 'a') as f:
l = "{},{},{},{}".format("symbol".upper(), "combined_privious_open_int".upper(),
"combined_current_open_int".upper(), "combined_open_int_percentage_change".upper())
f.write(l+"\n")
if not current_date_file or not os.path.isfile(current_date_file):
return
if not previous_date_file or not os.path.isfile(previous_date_file):
return
with open(current_date_file, 'r') as f:
for line in f:
if line.split(',')[0] in future_index_stock:
symbol = line.split(',')[1]
open_int = line.split(',')[12]
close = line.split(',')[8]
expiry_date = line.split(',')[2]
if symbol in filtered_current_date_file:
filtered_current_date_file[symbol].append(
"{},{},{},{}".format(symbol, open_int, close, expiry_date))
else:
filtered_current_date_file[symbol] = ["{},{},{},{}".format(symbol, open_int, close, expiry_date)]
with open(previous_date_file, 'r') as f:
for line in f:
if line.split(',')[0] in future_index_stock:
symbol = line.split(',')[1]
open_int = line.split(',')[12]
close = line.split(',')[8]
expiry_date = line.split(',')[2]
if symbol in filtered_privious_date_file:
filtered_privious_date_file[symbol].append(
"{},{},{},{}".format(symbol, open_int, close, expiry_date))
else:
filtered_privious_date_file[symbol] = ["{},{},{},{}".format(symbol, open_int, close, expiry_date)]
for symbol, list_of_line in filtered_privious_date_file.items():
combined_privious_open_int = 0
for v in list_of_line:
if '.' in v.split(',')[1]:
privious_open_int = float(v.split(',')[1])
else:
try:
privious_open_int = int(v.split(',')[1])
except ValueError:
print v.split(',')[1]
privious_open_int = 0
combined_privious_open_int = combined_privious_open_int + privious_open_int
combined_current_open_int = 0
for v in filtered_current_date_file[symbol]:
if '.' in v.split(',')[1]:
current_open_int = float(v.split(',')[1])
else:
try:
current_open_int = int(v.split(',')[1])
except ValueError:
print v.split(',')[1]
current_open_int = 0
combined_current_open_int = combined_current_open_int + current_open_int
try:
combined_open_int_percentage_change = ((combined_current_open_int/(combined_privious_open_int*1.0)
- 1)*100)
except (ZeroDivisionError):
combined_open_int_percentage_change = "NA"
with open('combined_future_open_int.csv', 'a') as f:
s = "{},{},{},{}".format(symbol, combined_privious_open_int, combined_current_open_int,
combined_open_int_percentage_change)
f.write(s+"\n")


Get Price Change
def compare_price_change(current_date_file, previous_date_file):
filtered_current_date_file = {}
with open('price_change.csv', 'a') as f:
s1 = "{},{},{},{},{}".format("symbol".upper(),
"previous_close".upper(),
"current_close".upper(),
"close_percentage_change".upper(),
"expiry_date".upper()
)
f.write(s1+"\n")
if not current_date_file or not os.path.isfile(current_date_file):
return
if not previous_date_file or not os.path.isfile(previous_date_file):
return
with open(current_date_file, 'r') as f:
for line in f:
if line.split(',')[0] in future_index_stock:
symbol = line.split(',')[1]
open_int = line.split(',')[12]
close = line.split(',')[8]
expiry_date = line.split(',')[2]
if symbol in filtered_current_date_file:
filtered_current_date_file[symbol].append(
"{},{},{},{}".format(symbol, open_int, close, expiry_date))
else:
filtered_current_date_file[symbol] = ["{},{},{},{}".format(symbol, open_int, close, expiry_date)]
with open(previous_date_file, 'r') as f:
for line in f:
if line.split(',')[0] in future_index_stock:
symbol = line.split(',')[1]
open_int = line.split(',')[12]
close = line.split(',')[8]
expiry_date = line.split(',')[2]
current_data=""
for v in filtered_current_date_file[symbol]:
if expiry_date in v:
current_data = v
# print expiry_date, symbol, v
else:
continue
if '.' in current_data.split(',')[2]:
current_close = float(current_data.split(',')[2])
else:
try:
current_close = int(current_data.split(',')[2])
except ValueError:
# print current_data.split(',')[2]
current_close = 0
if '.' in close:
previous_close = float(close)
else:
try:
previous_close = int(close)
except ValueError:
previous_close = 0
try:
close_percentage_change = (((current_close-previous_close)/previous_close)*100)
except (ZeroDivisionError):
close_percentage_change = "NA"
# print "open_int_percentage_change"
# print current_data.split(',')[1], open_int
# open_int_percentage_change = "N/A"
with open('price_change.csv', 'a') as f:
s = "{},{},{},{},{}".format(symbol, previous_close, current_close, close_percentage_change, expiry_date)
f.write(s+"\n")


Main Method
def main():
try:
previous_date = sys.argv[1]
current_date = sys.argv[2]
except:
print "Please pass the previous date and current date argument"
print "Example 16-05-2018 17-05-2018"
sys.exit(1)
remove_file('combined_ce_open_int.csv')
remove_file('combined_pe_open_int.csv')
remove_file('combined_future_open_int.csv')
remove_file('price_change.csv')
remove_file('combined_ce_and_pe_open_int.csv')
current_date_file = download_bhavcopy(current_date)
previous_date_file = download_bhavcopy(previous_date)
compare_price_change(current_date_file, previous_date_file)
get_future_oi_change(current_date_file, previous_date_file)
get_option_oi_change(current_date_file, previous_date_file)
#imported function from convertCSVToXLSX.py file
remove_file(current_date_file)
remove_file(previous_date_file)
csvtoxlsx.csvToxlsx()
#remove_file('unFormatedStock_Details.xlsx')


Remove File
def remove_file(file_name):
if os.path.isfile(file_name):
os.remove(file_name)


Call Main Method
if __name__ == '__main__':
main()

Higher High Lower Low CODE

How I calculate beta for stocks



 

Trading Levels Based on Daily Movements

Free Ka Gyan 01

                                                                            Join me on Telegram at: https://t.me/magictrend
Lesson #01
Till now you have seen my 7 or 8 Excel sheets
You will be wondering that how I can use at the same time an option sheet and a Breakout sheet
So here comes your experience
All the markets are not same
If market is very volatile then tens of supports and resistances are broken in a single day
Normally an option sheet gives an idea that where we can find a support and resistance, where a stock usually takes rest or swing
In current scenario nifty makes range of 500 to 800 points in a day
How can we expect that whatever support or resistances we are drawing. will play a vital role
So you must have watched that currently I am not posting any comments on options sheet
Because if volatility is high which we can see through India Vix, then breakouts work very well
as movement are very strong so whenever you feel a stock is rising and is near the resistance then in instead of selling, try to buy it over the resistance
One thing that I have noted through my experience is 1% ,the magical percent, if stocks move in a particular direction then there are chances that it will hit 1% in the same direction
So when I purchase above resistance then my First Target is always 1%
Is trading at 500 then the first target will be 505
If you don't have considerable cash or you are new to market try to avoid futures and options and always trade in cash
Advantage of trading in cash is that you can book your profit at various levels
suppose you buy something at 500 and the stock suddenly moves to 505 then instantly book half of your qty
as normally I never place my stop loss more than point 0.6%
That is 497 in my case
Booking half quantity at 505, even if you hit stop loss
still you will be in profit
This is just a part of money management or managing your trade



Lesson #02
Hi friend
Today I am going to discuss our Quest to find the Holy Grail system
And to break your heart I want to reveal that there is no such system exists that has 90% accuracy or 100% accuracy
I have seen many people searching the systems or amibroker afl that have 90% accuracy
And many times when they applied to current market they get wonderful results and when they try to use it for one or two months or longer.... then they see many whipsaws  and then they drop that particular formula and then shift to the new one and this process goes on for even years
And this race for searching the ultimate system never ends
But I told you earlier that I am earning my livelihood from intraday trading and you will be surprise to know that my system have only accuracy of 50% to 60%
So the real key is not finding in ultimate system but to sustain in the market you need ultimate money management
Normally I place target at 1% and stop loss at 0.5%
So if I get into 100 trade and with 60% accuracy
I profit 60 rupees and lose 20 rupees
Net gain will be 40 rupees
And normally I am in 2-3 trades at max, at the particular time
So lets summarise
I need 300 rupees to enter three simultaneous trade
Then keep on rotating this amount for hundred trades in a month
which gives me 40 rupees profit
So net return will be 40 rupees on 300 rupees that is 13%
And mind it
I have not considered the intraday exposure that I get from my broker
But to become a winner I need one more thing
That is consistency
What I experienced, In my past years, is three consecutive losing trade are enough to break you
When I lost most
Is when I was constantly winning and when I was constantly losing
After winning constantly for five times I got very loose on my rules and I started Breaking the rules
I thought myself to be the king of market
I felt that I know the market in its deep roots
I doubled my investment
Double exposure
Them a single losing trade wiped out my profit of 4 trades
Another case
Losing constantly for five times I lost my mental balance
I was dying to get my money back from the market
My emotions overpowered me
again I forgot all the rules
Suppose I have 5 conditions to meet, I entered the trade even when  three conditions meet
Which resulted in more loss
So then I realised that it is more important to be consistent then to be accurate
Then our emotions are under our control
We can analyse we can draw charts we can place targets we know what we are doing
We don't have to remember our god after entering a particular trade
When we lose after winning some trades
In our mind we just settle that oh... I will balance my profits with my this loss
So let settle the day with no profit no loss
In case of consecutive losses I have to transfer funds from my bank account to trading account
And then again I start feeling happy when I start profiting
I forgot at this point is that I am recovering only my losses
In the end of month the profit that I got is absolutely same amount that I transfer from Bank to trading account but still I thought that I am green

So my advice to all of you is don't run for accuracy but go for consistency
In next lesson of my experience I will share how I manage my money


Lesson #03
Before we move on to our next lesson in coming days, on position sizing, I want you all to read this story of wrestler Milo

It was about a Greek wrestler named Milo who lived many years back. He was one of the greatest wrestlers from Greece who had won six consecutive Olympic medals. Everyone wanted to know what his secret was and how he managed to be so strong and successful.

The story takes us to his village where Milo started his training by lifting a newborn calf while his competitors were trying to lift bulls in their practice sessions. Now anyone can lift a calf, even you and I can do that, there is nothing great in it. So how did Milo become great by doing that?

Milo used to carry his calf everywhere he went. Over time, the calf put on weight but Milo was still carrying him around. Milo's body and mind were getting used to lifting the calf even as it slowly grew. By the time the calf became a bull, Milo could lift it effortlessly, while his competitors were still struggling to lift the bull.

This story openes the concept of position sizing.



Lesson #04

I never forget to exit
Never over trade
Normally I keep 3-4% target for intraday during volatility
and when I meet that
I close my terminal otherwise i get tempted to trade more
which is disastrous
i am telling again n again
real money is cash not in ledger
so when i see enough cash profit in order book I stop
every monday I take payout of last week



Lesson #05
Hello friends
So as I have promised today we'll discuss position sizing
Now to start trading the first thing that we have to decide is the quantity to trade
Basically what the beginners do
They calculate their investment or capital
Then simply divide this capital with price of stock to get the quantity of rate
Suppose you have 100000rs and price of stock is 500
Then we enter 200 quantity
Which is absolutely wrong
so to Decide the correct quantity
We have to consider the loss
Like we have to enter the stock at 500 with target of 5 and stop loss of 3
We will check what is the maximum loss that I can bear
Like if I don't want to have loss greater than 500 on capital of 100000
My maximum loss is 500
And loss per share is 3
So quantity will be 166
This is called Position sizing

Secondly how to choose the capital to trade
We are very much attracted to what others are trading
Like on any channel if someone post that I got 10,000 profit on one lakh then we too think to invest 1 lakh immediately
Without considering the risks involved
Therefore I have shared the story of wrestler Milo in my lesson number 4
This is the same how I have increase my capital
I started with merely 5000 in 2007
What is the logic
Start with Capital of 5000, check your gains for losses in one week
If you are in profit increase the capital to 8000
If in loss remain at 5000
Again if you are in profit in second week then increase the capital to 12000
else be there
After increasing 3-4 thousand in initial stages
You can increase 6-7000 after reaching at the level of 50,000
But concept is simple be at same capital for the current week
if you have made loss in the previous week
In case of loss in two consecutive weeks
decrease capital to the previous level

Now comes the profit booking
You have to fix your ideology at Quick or slow
Like I myself is in category of quick
I am quick to book profit I am quick to book loss
What do you usually do
If we purchase Something for rupees hundred
Then we are quick to book profit at 102
But in case of loss we will wait at 97
Then when it comes to 97 we just hope for our entry point of 100
But it falls to 96
Then we repent and now start hoping for 98
But it falls to 94 now it's too costly to book here
So we convert and intraday to positional
As actually that stock was for intraday
Having no strength positionally it falls to 88
And we are trapped
If your slow in booking stop loss
Be slow in booking profit too
After buying at 100 wait for 110
I myself is always quick
Exit at 99.5
Book at 101

In the end I just want to say simple thing
Always keep strict stop loss
And try to book profit at every level
Suppose you buy something at 500
Target of 505 stop loss 497
Try to book Some quantity at 503
Then 504 then 505
If you book half quantity at 503 even you hit stop loss of 497
You are in profit
There is very tense environment while trading and while entering the trade
But your success depends very much on quantity u trade & price you book
Bye



Lesson #06
If you are retail option trader who mainly focus on naked option buying then follow this Simple rule.
Never buy a put option if price trades above previous day high.
Never buy a call option if price trades below previous day low.
This rule will save you a lot.


Lesson #07
7 great trend following indicators:
1) Moving averages
2) SuperTrend
3) Donchian Channel
4) Bollinger Bands
5) Keltner Channels
6) PSAR
7) ATR stop
if vix is high, lower the timeframe
if vix is low, higher the timeframe


Lesson #08
INDIAVIX
A simple layman explanation of VIX
it is a measure of expected volatility over the next 30 days
it is calculated using the nearest monthly expiry calls and puts
For eg, if VIX is at 50, it means that the expected annual change of Nifty over the next 30 days is at 50%
this means that Nifty is expected to be in the range of +50% to -50% from the current level for the next 1 year for the next 30 days.
In other words, from the current level of 9111, the range that is implied by VIX is 4555 to 13667
Expected range for the MONTH as implied by VIX is 50% / sqrt (365/30), which is 14.36%, ie 7802 to 10419
expected range for a DAY as implied by VIX is 50% / sqrt (365), which is around 2.62%, ie 8872 to 9349


Lesson #09
This is chart of ACC
I got a sell signal at selected line,   although I got  sell signal, still I have drawn a triangle manually  & waited for its breakout
as we can clearly see that it has given Breakout above 978  so I bought at 980 when it rested there

Chart of Adani ports
here I got buy signal at selector line
but again I didn't go by signal  and manually drawn the lines forming Triangle and traded only at break out of triangle

Chart of Cadilahc
 and you already know that No system is fool proof
 so here I am sharing the chart where it failed
 I got  buy signal at black Arrow but we know the golden formula that in stop-loss our loss must be less and in profit our  profit must be large
so when I bought at   break out at 356.20,   it rose to 358.10 and then fallen back
so I booked stop loss at 354.50
so you have seen that in such setups,  we can easily maintain risk reward ratio of 1:2

So what you have seen that as per my condition I get black arrows on scanning then I look out the chart to search a triangle if I found any, then I wait for breakout in either direction and trade as per breakout
so if you don't have any scanning code,   evn than you can easily spot this setup by naked eye
 and  trade as per breakout.   Stop loss will be less and risk reward ratio will be favourable

Lesson #10
Today we will start our lesson live
 I am giving here some stocks which have high beta
 we have to trade these stocks by using any tsl based method
we can use super  Trend with standard settings on 3 minute chart
This indicator is available everywhere
 every technical analysis software, every broker terminal
if gapup/gapdown, leave signals on 1st candle
then after market hours  we will discuss  the trades
and also what the "Beta" is
this is most simple form of trading and I used to trade by this method, 10 years back
let's begin, watch out
M&M, APOLLOTYRE, OIL, EQUITAS, TORNTPOWER, CENTURYTEX

**As its lesson only so just paper trade only




Lesson #12
Today's lesson is.... there are some cases when we enter a position even without a signal in supertrend.  This happens when a candle tests supertrend multiple Times.  Here I have attached chart of Grasim today.  See how first candle tested supertrend and again second candle tested supertrend as in this case we enter a buy,  and stop loss will be reverse signal in supertrend