Trade with Ajeet Singh

A Trading Hub for fellow traders, updated fortnightly.

How to choose stocks for Intraday





  1. Take out 4 hour time frame charts,
  2. Identify trend in 4 hour time frame using either price action - (HH HL & LL LH, VPL, VPH, MPH, MPL ) or simply with Super trend (8,2 or 10,3 settings) or PSAR or EMA's (50/200 EMA ) etc etc..
  3. After identifying trend, look for confirmation from momentum , using ADX or CCI etc etc
  4. If you get stocks that meets both criteria, then try those stocks for intraday..
  5. For doing it in intraday , follow same steps in 1 hours and 15 min charts... 1 hour chart for signal confirmation and 15 min chart trade entry....



    This way , you are going to trade in same direction of 4H, 1H and 15 Min..


    All Credits to: Marimuthu


Money Flow Index Trick



  1. Find out the previous day’s high and low.
  2. Find out current day’s high and low at any point of time.
     
  3. Note down 2 fractions (0.45 and 0.75)
  4. Find the range of previous day. (Previous day high – Previous day low)
  5. Multiply the range for previous day with the two fractions from step 3. (0.45 and 0.75). Mark this result as MF1 and MF2.
  6. Now find current day’s range (Today’s high – Today’s low)
  7. Find out whether current day’s range is below MF1, between MF1 and MF2 or above MF2.
  8. If current day’s range is below MF1, then breakout levels are Upside Breakout = Today’s low + MF1. Downside Breakout = Today’s high – MF1.
  9. If current day’s range is between MF1 and MF2, then breakout levels are Upside Breakout = Today’s low + MF2. Downside Breakout = Today’s high – MF2.
  10. If current day’s range is above MF2, then DO NOT TRADE.
  11. Once we know the breakout levels, we can buy above Upside Breakout and sell below Downside breakout.
  12. Target should be 0.7%.
  13. Stop loss should be 0.8% or if the underlying is trading below our buy price or above our sell price for more than 10 min, then square off the position.
  14. This trading system is best suitable for those who can trade in multiple stocks and are very active in trading. One should not expect more than 1% from this system.

    Note: This system should be used till 2 pm (or 1 and half hour before market closes. Because there is no point finding breakouts in last minutes of trading session)

    *The Money Flow Index (MFI)* is an oscillator that uses both price and volume to measure buying and selling pressure. MFI starts with the typical price for each period.

    Money flow is positive when the typical price rises (buying pressure) and negative when the typical price declines (selling pressure).

    A ratio of positive and negative money flow is then plugged into an RSI formula to create an oscillator that moves between zero and one hundred.

    As a momentum oscillator tied to volume, the Money Flow Index (MFI) is best suited to identify reversals and price extremes with a variety of signals.

28 Nov 2017




RSI Breakout Strategy


(Click image to Enlarge)


1ST POINT:
RSI MUST CROSS 60 

2ND POINT:
RSI MUST MAKE A PEAK ABOVE 60 

THEN RSI AFTER MAKING PEAK SHOULD SLOPE DOWN BUT SHOULDN'T SLOPE BELOW 60 3RD POINT

AFTER SLOPE IT SHOULD RISE AGAIN AND CROSS THE PEAK IT MADE FINAL POINT


RSI Calculation
1.    Typical Price = (High + Low + Close)/3
2.    Raw Money Flow = Typical Price x Volume
3.    Money Flow Ratio = (14-period Positive Money Flow)/(14-period Negative Money Flow)
4.    Money Flow Index = 100 - 100/(1 + Money Flow Ratio)


USE THIS SETUP FOR TIME BEING
·        RSI CROSSES 60
·        MFI CROSSES 60
·        RSI(14) Breakout


The RSI is classified as a momentum oscillator, measuring the velocity and magnitude of directional price movements. Momentum is the rate of the rise or fall in price. The RSI computes mo mentum as the ratio of higher closes to lower closes: stocks which have had more or stronger positive changes have a higher RSI than stocks which have had more or stronger negative changes

Uptrends generally traded between RSI 40 and 80, while Downtrends usually traded between RSI 60 and 20.

If the relative strength index is below 50, it generally means that the stock's losses are greater than the gains. When the relative strength index is above 50, it generally means that the gains are greater than the losses.

The slope of the RSI is directly proportional to the velocity of a change in the trend. The distance travelled by the RSI is proportional to the magnitude of the move.









27 Nov 2017

Stocks 20-20







22 Nov 2017

Stocks 20-20






Courtesy: cnbcstock2020.wordpress.com/




21 Nov 2017

Stocks 20-20







20 Nov 2017

Stocks 20-20







17 Nov 2017

Stocks 20 20









15 Nov 2017



BankNifty
Resistances at 25460 & 25520
If breaks 25520 and holds then will try to move 25620
Supports are at 25345 & 25275
and if trades below 25275 then next support at 25150




Sun Pharma: Sell - 526, Goal - 500, Stoplaus - 532

Gayle: Buy - 456, Goal - 475, Stoplaus - 450

Bank of Baroda: Buy - 174, Goal - 184, Stoplaus - 171

Lupine: Sell - 835, Goal - 800, Stoplaus - 845

Laurus Labs: Buy - 524, Goals - 535, Stoplaus - 521

Indiabulls Housing: Buy - 1192, Target - 1250, Stoplaus - 1180

Sumit Industries: Buy - 33.8, Goal - 37, Stoplaus - 33

Indo Count: Sell - 112, Goal - 100, Stoplaus - 115

Gitanjali James: Buy - 71.25, Goal - 80, Stoplaus - 70

Panicias Biotech: Buy - 231, Target - 245, Stoplaus - 225

Engineers India: Buy - 183, Goal - 195, Stoplaus - 180

NBCC: Buy - 270, Goal - 290, Stoplaus - 268

NHPC: Buy - 27, Target - 29, Stoplaus - 26.5

SJVN: Buy - 34, Goal - 36, Stoplaus - 33.5

Indian Bank: Buy - 401, Goal - 425, Stoplaus - 400

NLC India: Buy - 100, Goal - 110, Stoplaus - 98

HPCL: Buy - 493, Goal - 510, Stoplaus - 490

IOC: Buy - 387, Goal - 410, Stoplaus - 380

Chennai Petro: Buy - 419, Goal - 430, Stoplaus - 415

MRPL: Buy - 122, Goal - 135, Stoplaus - 120



14 Nov 2017



BankNifty
Resistances at 25500 & 25560
If breaks 25560 and holds then will try to move 25650
Supports are at 25400 & 25350
and there after 25250
If afraid of BNF then apply any EMA trade to YESBANK

Nifty
Expected to open flattish note
Resistances at 10295 & 10320
If breaks 10320 and holds then will try to move 10375
Supports at 10240 & 10215
Below 10215 I see more selling pressure upto 10190










Google Data Downloader

Sincere thanks to RMIKE for this wonderful utility





  1. This is a Python distributable utility to download 1 min historical data for NSE from Google finance. This is compiled to work on Microsoft Windows OS. Will not work for Mac and Linux OS.
  2. Important – Follow all instructions regarding package and file placement. Don’t modify the name of any file or folder!!!
  3. Download the zip package from the provided link, unzip the package to the root directory of your C: drive. This will place the ‘PyDownloader’ Folder in C: drive, like so “C:\PyDownloader”.
  4. Inside the PyDownloader Folder, you’ll find the following :-

    (a) ‘TickerList’ Text File – Enter Ticker symbols for which data is required. The sample Tickers viz. Nifty & BANKNIFTY are placed in the list as reference example. Input to list each desired Ticker in a separate line. The maximum limit of the TickerList is 100 Tickers
    (b) ‘Data’ Folder – The downloaded 1 min historical data by the utility will be written to this folder as a csv file for each individual Ticker in the TickerList. Historical 1 min IEOD can be downloaded for a maximum of 15 trading days.
    (c) ‘PyD.format’ File – If you wish to manually import the downloaded IEOD into Amibroker, place this file in the ‘Formats’ Folder of your Amibroker installation. You’ll also need to edit the ‘import.types’ file in the Formats folder by inserting the following instruction.PyDownloader (*.*)|*.*|PyD.format

    (d) ‘PyDn_v1.0_Lic’ – The License file for the utility.(e) ‘PyDn_v1.0 Help’ Pdf File – Help file.(f) ‘PyDownloader_nse_v1.0.exe’ – The executable distro package of the utility.
  5. After inputting desired Tickers in TickerList, double click on PyDownloader_nse_v1.0.exe. A console window will pop up. This window will remain inactive for some while (approx. 40 to 65 seconds, depending upon your rig’s CPU and RAM configuration) during which the Python virtual environment is loaded for the utility to function.
  6. After the virtual environment loading is complete, the console window becomes active. As the utility executes, it will ask the user to input the desired no. of days for which IEOD is required to be downloaded.
  7. Input the no. of days as a NUMBER. For e.g Three days = 3 and NOT 03 OR Three. And Fourteen days = 14 and NOT 014 OR Fourteen. After providing input, press Enter/ Return. The utility will then execute as per the user input for no. of days and no. of Tickers in TickerList. The image below illustrates the example of downloading IEOD for 1 day for NIFTY & BANKNIFTY.
  8. After the process is complete, the utility and the console window will auto exit. The IEOD can then be imported from the ‘Data’ Folder
  9. This utility is distributed ‘as is’ without any cost to user for providing retail traders with means to utilize publically available data from Google Finance for analytical purposes. No user is authorized to distribute this utility without credit to the copyright holder(s). No user is authorized to commercialize this utility in any form.





PairTrading Recommendations


Recommendations for Pair Trade:





Problem in viewing?
Visit Here and refresh

Fetching Intraday data from Google using Python

All credits to RMIKE

Here is an yet another interesting python tutorial to fetch intraday data using Google Finance API , store the data in csv format and also plot the intraday data as candlestick format. We are using plotly library for plotting candlestick charts and pandas to manage time-series data. Luckily found and interesting python code which fetches google intraday data and store in csv format. Done some little modification in the code (exchange added to the Google API) so that one can fetch data for any exchange.
In our example we try to retrieve the data (Date,Time,Symbol,Open,High,Low,Close,Volume data) for RCOM (Reliance Communication) and plot as candlesticks using plotly library. Download the sample RCOM CSV file fetched from Google Finance
Sample IPython Notebook using Plotly and pandas to plot Interactive Intraday Candlestick Charts using Google Finance API :


In [1]:
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()

In [2]:
import plotly
plotly.__version__
Out[2]:
'1.9.0'

Code to Fetch Google Intrday Data and Save in CSV Format



In [7]:

# Copyright (c) 2011, Mark Chenoweth
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted 
# provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 
#   disclaimer in the documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import urllib,time,datetime
import  pandas as pd


class Quote(object):
  
  DATE_FMT = '%Y-%m-%d'
  TIME_FMT = '%H:%M:%S'
  
  def __init__(self):
    self.symbol = ''
    self.date,self.time,self.open_,self.high,self.low,self.close,self.volume = ([] for _ in range(7))

  def append(self,dt,open_,high,low,close,volume):
    self.date.append(dt.date())
    self.time.append(dt.time())
    self.open_.append(float(open_))
    self.high.append(float(high))
    self.low.append(float(low))
    self.close.append(float(close))
    self.volume.append(int(volume))
      
  def to_csv(self):
    return ''.join(["{0},{1},{2},{3:.2f},{4:.2f},{5:.2f},{6:.2f},{7}\n".format(self.symbol,
              self.date[bar].strftime('%Y-%m-%d'),self.time[bar].strftime('%H:%M:%S'),
              self.open_[bar],self.high[bar],self.low[bar],self.close[bar],self.volume[bar]) 
              for bar in xrange(len(self.close))])
    
  def write_csv(self,filename):
    with open(filename,'w') as f:
      f.write(self.to_csv())
        
  def read_csv(self,filename):
    self.symbol = ''
    self.date,self.time,self.open_,self.high,self.low,self.close,self.volume = ([] for _ in range(7))
    for line in open(filename,'r'):
      symbol,ds,ts,open_,high,low,close,volume = line.rstrip().split(',')
      self.symbol = symbol
      dt = datetime.datetime.strptime(ds+' '+ts,self.DATE_FMT+' '+self.TIME_FMT)
      self.append(dt,open_,high,low,close,volume)
    return True

  def __repr__(self):
    return self.to_csv()

class GoogleIntradayQuote(Quote):
  ''' Intraday quotes from Google. Specify interval seconds and number of days '''
  def __init__(self,symbol,interval_seconds=300,num_days=5):
    super(GoogleIntradayQuote,self).__init__()
    self.symbol = symbol.upper()
    url_string = "http://www.google.com/finance/getprices?q={0}".format(self.symbol)
    url_string += "&x=NSE&i={0}&p={1}d&f=d,o,h,l,c,v".format(interval_seconds,num_days)
    csv = urllib.urlopen(url_string).readlines()
    for bar in xrange(7,len(csv)):
      if csv[bar].count(',')!=5: continue
      offset,close,high,low,open_,volume = csv[bar].split(',')
      if offset[0]=='a':
        day = float(offset[1:])
        offset = 0
      else:
        offset = float(offset)
      open_,high,low,close = [float(x) for x in [open_,high,low,close]]
      dt = datetime.datetime.fromtimestamp(day+(interval_seconds*offset))
      self.append(dt,open_,high,low,close,volume)
   
   
if __name__ == '__main__':
  q = GoogleIntradayQuote('RCOM',300,30)
  #print q                                           # print it out
  q.write_csv('c://data//rcom.csv')  


Read the CSV file and Convert into Dataframe


In [4]:
dateparse = lambda x: pd.datetime.strptime(x, '%Y-%m-%d %H:%M:%S')  
df = pd.read_csv('c://data//rcom.csv',sep=',',header=None, parse_dates={'datetime': [1, 2]}, date_parser=dateparse)
df.columns = ['Datetime', 'Symbol','Open','High','Low','Close','Volume']
#df.index = df['Datetime']
#df.index.name = None
df.head(5)


Out[4]:

DatetimeSymbolOpenHighLowCloseVolume
02015-10-14 09:20:00RCOM77.8078.5077.6078.40552244
12015-10-14 09:25:00RCOM78.4079.0578.3078.85546950
22015-10-14 09:30:00RCOM78.7578.8578.2578.25223054
32015-10-14 09:35:00RCOM78.3078.5078.2578.35125523
42015-10-14 09:40:00RCOM78.4078.6578.3578.55105811


Plot the intrday data as charts using plotly

In [5]:
from datetime import date
import plotly.plotly as py
from plotly.tools import FigureFactory as FF
from datetime import datetime

In [9]:
fig = FF.create_candlestick(df.Open, df.High, df.Low, df.Close, dates=df.index)
fig['layout'].update({
    'title': 'RCOM Intraday Charts',
    'yaxis': {'title': 'RCOM Stock'}})
py.iplot(fig, filename='finance/intraday-candlestick', validate=False)
The draw time for this plot will be slow for all clients.

Out[9]: