Showing posts with label technical analysis. Show all posts
Showing posts with label technical analysis. Show all posts

Saturday, December 31, 2016

Trading stocks that open with a gap and do they trend

Markets are random by nature.  We have to look for events where the market will behave in a non random fashion.

Take the stocks which opened with a gap of more than 2%, then wait for 5/15 minutes for the stock to set the opening range. Then, take the trade in the direction which is showing strength.

For analysis purpose, lets start with gap up of more than 2%, does the stock rise? Data tested from 2012.

StockName , Sum of (close-open) %, Sum of abs(close-open)%,  No of trades in 4 years


JPASSOCIAT   -27.32610219 186.49 49
HDIL         6.918107082 112.75 35
ARVIND       -15.62888451 37.44 10
ADANIENT     -5.435449073 54.09 18
HAVELLS      -21.25835332 41.05 9
MARICO       -39.96573965 59.93 21
INDIACEM     -68.85385005 124.15 37
ORIENTBANK   -42.11056829 115.61 36
AUROPHARMA   -46.51498804 91.83 20
ABIRLANUVO   -12.20098535 41.41 16
HINDPETRO    -22.54552241 80.6 29
LTFH         -26.20525764 86.26 35
TORNTPHARM   -65.52778734 95.43 40
BOSCHLTD     -18.62853516 37.35 18
JISLJALEQS   -43.31868274 101.4 28
GMRINFRA     -87.8594496 172.09 61
GAIL         -12.51424082 21.94 12
JUBLFOOD     -4.557456022 22.45 7
SRTRANSFIN   2.299413528 46.95 15
SINTEX       -23.85124559 98.82 37
SIEMENS      -15.55014222 21.18 10
SUNPHARMA    -2.391231081 22.7 14
JUSTDIAL     -15.71188357 50.5 14
ITC          2.886965737 5.11 3
APOLLOHOSP   -37.66990604 38.11 13
POWERGRID    0 0 0
GRASIM       11.04174322 11.19 4
INFY         -2.500189208 38.98 14
IGL          -13.85018987 42.93 14
RPOWER       -18.61653415 39.83 24
BHEL         16.12160525 45.63 20
GODREJCP     -89.51885313 90.26 28
BEML         -14.88913373 58.07 33
PNB          -28.62738614 59.73 18
TATACOMM     -19.49069376 88.32 32
OIL          -52.08247373 53.01 22
NIITTECH     -64.8338293 88.24 29
ALBK         -13.04923915 58.39 24
IDEA         -33.27583111 47.3 17
CROMPGREAV   -49.9852008 71.38 24
IDFCBANK     -9.65067349 9.65 7
TATACHEM     -20.10151924 25.29 13
BANKINDIA    -41.17012134 108.86 36
RCOM         4.287864937 80.79 26
MCDOWELL_N   -5.030194248 94 21
JSWENERGY    -19.23503614 149.36 40
ICICIBANK    8.120235266 39.84 26
TITAN        -17.77907956 59.17 17
IBREALEST    28.64923837 197.22 52
DISHTV       -7.809799645 49.45 21
RELINFRA     17.08722569 44.91 21
ACC          3.485578844 3.49 2
RELCAPITAL   15.13681549 75.17 28
RELIANCE     5.448744172 25.64 13
TATAELXSI    -19.61787874 26.67 13
UPL          3.918800681 5.79 4
RECLTD       14.44721147 41.51 18
AXISBANK     -2.395651934 55.77 28
JETAIRWAYS   -48.34884996 196.7 55
EICHERMOT    -74.99507894 129.14 51
JSWSTEEL     12.25074036 20.77 7
SOUTHBANK    -95.69516029 120.74 35
ASHOKLEY     -101.8843838 168.37 56
CADILAHC     -50.51199764 54.84 18
BANKBARODA   -6.932646783 67.95 21
BAJFINANCE   -40.38318483 78.94 38
ZEEL         -20.52294228 30.8 11
IRB          -34.8279921 91.9 37
TECHM        -45.58843225 69.61 18
ASIANPAINT   -5.630510755 5.63 3
WOCKPHARMA   -72.70258187 154.88 56
SBIN         -13.41877562 57 23
COLPAL       -44.48511644 46.1 14
LUPIN        -26.44000687 29.67 11
GODREJIND    -37.92813947 70.67 19
ADANIPORTS   -20.03265154 69.62 21
ANDHRABANK   -17.37331468 75.96 25
ULTRACEMCO   -8.093124692 31.9 13
IBULHSGFIN   3.853731371 41.68 13
AMBUJACEM    7.75268395 8.37 5
NCC          -92.74904606 310.37 76
FEDERALBNK   -61.58029764 92.88 37
TATAMTRDVR   -13.29062406 53.31 28
AJANTPHARM   -50.48423589 66.21 32
HINDUNILVR   -4.30677195 27.83 7
BHARTIARTL   -2.760943506 41.24 19
NTPC         7.108794797 13.48 6
HEXAWARE     -0.178899116 68.13 28
CANBK        -12.01056846 87.46 28
PFC          2.759165233 85.42 25
CUMMINSIND   -55.84490326 68.18 26
INFRATEL     -40.9635048 70.71 20
SRF          -46.21250814 106.32 38
EXIDEIND     -21.66887638 35.29 13
TATAGLOBAL   -25.69903946 52.64 17
TATAPOWER    -13.91952694 34.76 17
WIPRO        -5.162923704 16.2 10
LT           18.5049291 26.18 13
HCLTECH      -16.32849032 21.52 10
DABUR        -31.31283597 38.9 11
SYNDIBANK    -34.42217561 88.31 31
CASTROLIND   3.103825563 10.8 2
SUNTV        -7.577627704 62.85 20
TCS          -5.647374233 24.04 12
COALINDIA    -17.60770549 23.05 10
YESBANK      19.03962631 109.24 35
KOTAKBANK    -16.81416131 36.62 16
DLF          51.90427002 110.47 40
BEL          -44.58298807 92.13 29
CESC         -16.95623089 35.82 15
TORNTPOWER   -49.25612942 90.26 30
KPIT         -32.02608543 93.03 37
UNIONBANK    -34.17727551 87.42 25
NMDC         -6.231011045 39.84 17
GRANULES     -75.89438033 201.04 55
MM           -6.308605213 11.57 6
CIPLA        -11.26761811 15.09 9
OFSS         -22.42548012 30.39 16
PTC          -6.489572282 80.5 32
HDFC         -12.51945461 27.48 11
CEATLTD      -45.521239 69.88 25
PETRONET     -20.16833721 23.07 11
GLENMARK     -26.93497808 56.51 19
IDBI         -43.48651127 77.21 30
KSCL         -131.629617 209.67 79
ICIL         -731.3678047 1110.89 246
INDUSINDBK   -44.40555381 75.31 27
CAIRN        -21.22236281 57.47 22
BIOCON       -12.68110054 23.31 11
LICHSGFIN    -5.347311302 52.09 21
BHARATFORG   -17.4231582 46.18 20
MCLEODRUSS   -62.04295853 89.38 23
HINDALCO     -16.38579565 47.39 24
CONCOR       -95.64042868 117.35 40
MARUTI       -1.171339638 23.72 8
IOC          -49.4409745 61.85 22
PCJEWELLER   -82.93014342 175.21 47
DCBBANK      3.362272377 44.64 19
BRITANNIA    -21.58679726 45.79 19
PIDILITIND   -43.36076451 50.15 22
HEROMOTOCO   -20.27581526 20.28 8
PAGEIND      -84.75346482 97.97 39
NHPC         -74.29842794 98.13 27
HDFCBANK     -11.14099193 24.33 10
TATAMOTORS   19.41665744 42.91 29
BATAINDIA    -5.230801989 12.75 6
CENTURYTEX   1.969653423 36.08 18
VEDL         3.633897425 49 16
APOLLOTYRE   -50.73160818 59.29 20
DRREDDY      -8.280705509 10.73 6
TATASTEEL    -1.797890652 52.01 22
MRF          -21.95918899 26.92 13
DHFL         21.59590695 52.31 13
AMARAJABAT   -4.439943169 60.91 18
ONGC         3.323130734 47.41 21
MOTHERSUMI   -43.79802951 70.95 32
KTKBANK      -43.05275324 82.55 35
HINDZINC     -54.70236533 68.74 23
STAR         -70.41790671 80.6 21
ADANIPOWER   -56.99759995 113.94 45
BAJAJ_AUTO   -10.34207351 14.3 7
SAIL         1.993593884 47.59 22
TV18BRDCST   -61.1422626 226.33 55
BPCL         2.311829919 54.47 21
MINDTREE     -45.91844294 64.12 28
DIVISLAB     -24.82082949 45.18 15
JINDALSTEL   -23.03375172 95.34 30
UBL          -51.5736475 58.57 18
VOLTAS       -22.43468784 76.88 23
MMFIN        -64.98440681 93.73 30
BHARATFIN    0 0 0
TVSMOTOR     -140.0207785 183.65 50
IFCI         -23.62337616 104.79 37
IDFC         -3.258244886 81.15 27

Total trades : 4255
Total sum of % change(2nd column) : -5031%. Gaps getting filled.
Total sum of abs change : 12570.

2.95% change per trade.

The results look, stocks seem to be trending after a gap up.

Let's take a look from the gap down of more than 2%.

StockName, sum of % Change open -close, Sum of absolute % change open-close, no of trades



JPASSOCIAT   16.2 138.15 39
HDIL         -2.96 161.84 36
ARVIND       -6.44 29.34 12
ADANIENT     72.16 143.45 17
HAVELLS      -18.38 36.78 10
MARICO       -11.42 18.29 10
INDIACEM     -64.62 115.8 32
ORIENTBANK   -2.53 66.61 25
AUROPHARMA   -23.99 55.85 19
ABIRLANUVO   -11.69 51.2 13
HINDPETRO    -30.11 71.26 14.00
LTFH         -13.61 36.1 13
TORNTPHARM   -57.08 90.08 28
BOSCHLTD     -6.75 12.81 5.00
JISLJALEQS   -12.28 81.72 24.00
GMRINFRA     -39.73 114.21 39
GAIL         -7.41 10.16 8
JUBLFOOD     -24.72 35.6 10
SRTRANSFIN   -32.07 75.41 19
SINTEX       -12.97 82.87 23
SIEMENS      -4.12  7.48 4
SUNPHARMA    -5.05 28.73 13.00
JUSTDIAL     -1.02 43.47 14
ITC          -3.41  3.41 2
APOLLOHOSP   -7.38 18.79 7
POWERGRID    -0.35 16.51 4.00
GRASIM       -1.84  7.53 3
INFY         30.27 41.48 13
IGL          19.36 29.16 4
RPOWER       15.21 28.12 9
BHEL         12.52 49.57 13
GODREJCP     -73.45 73.6 12
BEML         -25.02 66.62 29.00
PNB          -5.9 44.52 15
TATACOMM     -15.53 39.11 12
OIL          -4.99 26.61 13
NIITTECH     -55.04 80.99 33
ALBK         -28.98 52.1 15
IDEA         -50.62 63.75 20
CROMPGREAV   -33.62 69.57 20
IDFCBANK      7.53  7.53 3
TATACHEM     -4.15 26.9 10
BANKINDIA    11.92 62.87 22
RCOM         -16.65 71.49 17
MCDOWELL_N   -73.52 94.45 18
JSWENERGY    -63.17 110.63 32.00
ICICIBANK     5.25 22.88 12
TITAN        -17.36 50.7 13
IBREALEST     3.02 101.82 28
DISHTV       -55.98 82.05 23
RELINFRA      3.78 56.11 12
ACC          -17.73 17.73 7
RELCAPITAL   -10.72 54.21 14.00
RELIANCE      5.25  9.67 4
TATAELXSI    -45.87 83.96 21.00
UPL          12.34 18.19 7.00
RECLTD        5.25 48.94 16
AXISBANK     16.94 52.21 19
JETAIRWAYS   -49.46 116.18 31
EICHERMOT    -16.46 43.68 16
JSWSTEEL     -21.74 35.55 9.00
SOUTHBANK    -51.65 52.89 14.00
ASHOKLEY     -113.38 139.88 31
CADILAHC     -14.19 28.52 12
BANKBARODA   -19.2 33.22 14
BAJFINANCE   -45.48 65.37 20
ZEEL         -23.64 31.22 12
IRB          -7.85 88.96 25
TECHM        -17.76 47.19 16
ASIANPAINT    7.40  8.27 6
WOCKPHARMA   -96.04 160.31 51
SBIN         -16.88 39.62 14
COLPAL       -30.54 32.97 10
LUPIN        -34.55 39.57 11
GODREJIND    -27.51 51.15 10.00
ADANIPORTS   -38.8 56.6 17
ANDHRABANK   -9.44 50.66 15
ULTRACEMCO   -40.18 42.18 12
IBULHSGFIN   -6.78 53.94 21.00
AMBUJACEM    -14.61 21.71 11
NCC          -18.15 133.37 35
FEDERALBNK   -9.07 42.56 21
TATAMTRDVR   -19.13 64.98 21
AJANTPHARM   -14.14 60.45 18
HINDUNILVR   -4.81  5.29 3.00
BHARTIARTL   -17.97 34.59 10
NTPC         17.55 20.71 5
HEXAWARE     -38.39 45.86 15
CANBK         8.85 72.95 23
PFC          -5.41 32.09 14
CUMMINSIND   -26.23 26.23 6
INFRATEL     -130.12 164.1 43
SRF          -31.1 92.87 29
EXIDEIND     -31.19 37.67 13.00
TATAGLOBAL   -38.24 39.55 11
TATAPOWER    -24.2 42.94 13
WIPRO         8.29 31.26 15
LT            1.18 21.3 9
HCLTECH      -2.82 30.99 15.00
DABUR        -7.7 18.26 9
SYNDIBANK    -3.3 58.34 20
CASTROLIND    3.89  7.48 2
SUNTV         7.93 95.81 20
TCS           7.06 15.86 10
COALINDIA    -7.23 18.93 12.00
YESBANK      20.01 65.57 17
KOTAKBANK     3.41 17.27 10.00
DLF          22.64 130.85 33
BEL          -33 58.36 20
CESC          9.72 35.97 11.00
TORNTPOWER   -12.88 44.98 13
KPIT         -41.88 128.09 20
UNIONBANK    -7.25 91.61 26
NMDC         -15.32 34.51 18
GRANULES     -47.62 76.22 17
MM           -5.85 19.4 9
CIPLA        10.63 10.63 3.00
OFSS         -13.94 37.18 14
PTC          -48.77 76.29 21.00
HDFC          2.82  9.48 6
CEATLTD      -127.23 149.91 40.00
PETRONET     -17.09 28.58 13.00
GLENMARK     -26.91 35.52 15
IDBI         -21.2 61.05 17
KSCL         -103.22 119.09 31
ICIL         -843.02 952.07 212
INDUSINDBK    3.56 32.62 11
CAIRN        -1.74 55.87 20.00
BIOCON       -15.66 30.77 7
LICHSGFIN    -10.1 32.65 9
BHARATFORG   -12.17 23.03 11
MCLEODRUSS   -34.88 57.19 12
HINDALCO     -26.71 55.35 22
CONCOR       -30.21 50.34 21
MARUTI        3.93 20.72 9.00
IOC          -33.44 46.33 17.00
PCJEWELLER   -9.99 57.56 25
DCBBANK      16.39 28.83 6
BRITANNIA    -47.58 49.86 8
PIDILITIND   -12.76 19.57 11.00
HEROMOTOCO   -8.35 11.47 6
PAGEIND      -31.62 48.33 22.00
NHPC         -54.90 56.13 10.00
HDFCBANK      4.90  5.68 3
TATAMOTORS    0.30 58.11 21.00
BATAINDIA    -28.16 49.27 20
CENTURYTEX   -17.09 53.88 16
VEDL          9.2 67.7 14
APOLLOTYRE   10.25 74.29 14
DRREDDY      -6.25  8.79 5
TATASTEEL    -3.53 46.96 14.00
MRF          -12.71 16.04 6
DHFL         -2.34 65.91 19.00
AMARAJABAT   -62.64 76.35 17
ONGC         -0.02 30.35 15
MOTHERSUMI   -54.38 92.23 24
KTKBANK      -39.68 76.6 16
HINDZINC     -32.86 32.86 15
STAR         -61.71 96.66 19
ADANIPOWER    8.28 67.00 21.00
BAJAJ_AUTO    4.15  9.59 5
SAIL         -6.84 40.34 13.00
TV18BRDCST   -38.97 76.3 29
BPCL         -0.03 27.74 11
MINDTREE     -23.77 41.19 14
DIVISLAB     -19.01 19.01 6
JINDALSTEL   -15.41 127.8 31
UBL          -12.96 48.88 15
VOLTAS       -45.61 71.98 24
MMFIN        -30.35 49.92 14
BHARATFIN     0.00  0 0
TVSMOTOR     -71.71 80.62 28
IFCI         -96.71 167.07 27
IDFC         20.68 69.01 16


In gap down, movement is good.

Total trades : 2984.
Total sum of open -close % (2nd column): -4069. => Gaps filled.
Sum of absolute change(3rd column) : 10252.

It shows a movement of 3.43% per trade.

The above also shows gaps are often filled. Now, further study needs to be done on the Opening range breakout on the stocks with a gap.


Saturday, December 24, 2016

Option charts for last month expiry.

Option charts for last month expiry. Strike Price choosen is Setltement Monday means Monday before Thursday expiry.

























Saturday, December 17, 2016

Python script for finding NR7 stocks




It is difficult to upload the NR7 stocks everyday. So, I am sharing the python script here.

import re
import urllib2
import json
import matplotlib.pyplot as plt
import time


print("NR7 Stocks")
def check(stockname):
   

    proxy_support = urllib2.ProxyHandler({"http":"http://61.233.25.166:80"})
    opener = urllib2.build_opener(proxy_support)
    opener.addheaders = [('User-agent', 'Mozilla/5.0')]
    urllib2.install_opener(opener)
   
    url="https://www.google.com/finance/getprices?q="+stockname+"&x=NSE&i=86400&p=7d&f=d,c,h,l,o,v"
    html = urllib2.urlopen(url).read()
 
    min_diff=1000000
    for line in html.split()[7:]:
        diff=float(line.split(',')[2])-float(line.split(',')[3])
      
        if(min_diff>diff):
            min_diff=diff
        #print(stockname,diff,min_diff,float(line.split(',')[2]),float(line.split(',')[3]))
    if(abs(diff-min_diff)<0.01):
        print(stockname)
    return;
  

symbolslist=["ABIRLANUVO", "ACC", "ADANIENT", "ADANIPORTS", "ADANIPOWER", "AJANTPHARM", "ALBK", "AMARAJABAT", "AMBUJACEM", "ANDHRABANK", "APOLLOHOSP", "APOLLOTYRE", "ARVIND", "ASHOKLEY", "ASIANPAINT", "AUROPHARMA", "AXISBANK", "BAJAJ-AUTO", "BAJFINANCE", "BANKBARODA", "BANKINDIA", "BATAINDIA", "BEL", "BEML", "BHARATFIN", "BHARATFORG", "BHARTIARTL", "BHEL", "BIOCON", "BOSCHLTD", "BPCL", "BRITANNIA", "CADILAHC", "CAIRN", "CANBK", "CASTROLIND", "CEATLTD", "CENTURYTEX", "CESC", "CIPLA", "COALINDIA", "COLPAL", "CONCOR", "CROMPGREAV", "CUMMINSIND", "DABUR", "DCBBANK", "DHFL", "DISHTV", "DIVISLAB", "DLF", "DRREDDY", "EICHERMOT", "ENGINERSIN", "EXIDEIND", "FEDERALBNK", "GAIL", "GLENMARK", "GMRINFRA", "GODREJCP", "GODREJIND", "GRANULES", "GRASIM", "HAVELLS", "HCLTECH", "HDFC", "HDFCBANK", "HDIL", "HEROMOTOCO", "HEXAWARE", "HINDALCO", "HINDPETRO", "HINDUNILVR", "HINDZINC", "IBREALEST", "IBULHSGFIN", "ICICIBANK", "ICIL", "IDBI", "IDEA", "IDFC", "IDFCBANK", "IFCI", "IGL", "INDIACEM", "INDUSINDBK", "INFRATEL", "INFY", "IOC", "IRB", "ITC", "JETAIRWAYS", "JINDALSTEL", "JISLJALEQS", "JPASSOCIAT", "JSWENERGY", "JSWSTEEL", "JUBLFOOD", "JUSTDIAL", "KOTAKBANK", "KPIT", "KSCL", "KTKBANK", "LICHSGFIN", "LT", "LUPIN", "MARICO", "MARUTI", "MCDOWELL-N", "MCLEODRUSS", "MINDTREE", "MOTHERSUMI", "MRF", "NCC", "NHPC", "NIITTECH", "NMDC", "NTPC", "OFSS", "OIL", "ONGC", "ORIENTBANK", "PAGEIND", "PCJEWELLER", "PETRONET", "PFC", "PIDILITIND", "PNB", "POWERGRID", "PTC", "RCOM", "RECLTD", "RELCAPITAL", "RELIANCE", "RELINFRA", "RPOWER", "SAIL", "SBIN", "SIEMENS", "SINTEX", "SOUTHBANK", "SRF", "SRTRANSFIN", "STAR", "SUNPHARMA", "SUNTV", "SYNDIBANK", "TATACHEM", "TATACOMM", "TATAELXSI", "TATAGLOBAL", "TATAMOTORS", "TATAMTRDVR", "TATAPOWER", "TATASTEEL", "TCS", "TECHM", "TITAN", "TORNTPHARM", "TORNTPOWER", "TV18BRDCST", "TVSMOTOR", "UBL", "ULTRACEMCO", "UNIONBANK", "UPL", "VEDL", "VOLTAS", "WIPRO", "WOCKPHARMA", "YESBANK", "ZEEL"]
index=0
while(index<len(symbolslist)):
    check(symbolslist[index])
    index=index+1
    #time.sleep(1)

Script Link

http://pastebin.com/KQH5PYcn