Trade with Ajeet Singh

Free stuff for trading

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.

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.









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]:



TD Sequential

Tom Demark Sequential

Books which I have found and have read:
New Market Timing Techniques - Thomas R. Demark. Written by Tom Demark itself but it is difficult to read and understand. I have needed several months to understand the idea and to summarize the information bellow.... and than I found the following book:
DeMark INDICATORS - Jason Perl. A great book about Demark indicators easy to read and understand. The theory is presented in a way which is very easy to understand. I recommend you to read it. But Murphy's law I have found it one week later... when I already had the information which I have needed:)

The post is not intended to be a comprehensive guide how to trade using Tom Demark's technique there is books about that. In "DeMark INDICATORS by Jason Perl" for example you can find the info - when trading signal is appearing/entry level/stop level etc. and much more TD indicators and techniques.
The post is intended to be a quick reference so we do not need to look for the rules each time on Internet or in the books:) I will post my thoughts and some charts which will help you to understand how to apply Tom Demark's method in the practice. I am not a Pro but I hope that the post will be a good starting point for you to start using TD Sequential in real trading.

------------------------------------------------------------------------------------------------------------------------------------

TD Sequential indicator consist of two components. TD Setup is the first one and it is a prerequisite for the TD Countdown – the second component.

1.TD Setup
TD Setup compares the current close with the corresponding close four bars earlier. There must be nine consecutive closes higher/lower than the close four bars earlier.

TD Buy Setup - prerequisite is a bearish price flip, which indicates a switch from positive to negative momentum.
– After a bearish price flip, there must be nine consecutive closes, each one less than the corresponding close four bars earlier.
– Cancellation - If at any point a bar closes higher than the close four bars earlier the setup is canceled and we are waiting for another price flip
- Setup perfection – the low of bars 8 or 9 should be lower than the low of bar 6 and bar 7 (if not satisfied expect new low/retest of the low).

TD Sell Setup - prerequisite is a bullish price flip, which indicates a switch from negative to positive momentum.
– After a bullish price flip, there must be nine consecutive closes, each one higher than the corresponding close four bars earlier.
– Cancellation - If at any point a bar closes lower than the close four bars earlier the setup is canceled and we are waiting for another price flip
- Setup perfection – the high of bars 8 or 9 should be greater than the high of bar 6 and bar 7 (if not satisfied expect new high/retest of the high).

----------------------------------------------

2. TD Countdown - after a setup is finished the countdown can begin from bar 9 of the setup.
TD Countdown compares the current close with the low/high two bars earlier and you count 13 bars. Unlike the Setup, the Countdown doesn’t have to be a sequence of 13 consecutive price bars. If it is interrupted you just do not count the bars and when it resumes you continue counting further.

TD Buy Countdown starts after the finish of a buy setup. The close of bar 9 should be less than the low two bars earlier. If satisfied bar 9 of the setup becomes bar 1 of the countdown. If the condition is not met than bar 1 of the countdown is postponed until the conditions is satisfied and you continue to count until there are a total of thirteen closes, each one less than, or equal to, the low two bars earlier.
Countdown qualifier - The low of Countdown bar thirteen must be less than, or equal to, the close of Countdown bar eight.
Countdown cancellation:
- A sell Setup appears. The price has rallied in the opposite direction and the market dynamic has changed.
- close above the highest high for the current buy Setup (break of TDST for the current Setup)
- recycle occurs ( new Setup in the same direction and recycle activated )

TD Sell Countdown starts after the finish of a sell setup. The close of bar 9 should be greater than the high two bars earlier. If satisfied bar 9 of the setup becomes bar 1 of the countdown. If the condition is not met than bar 1 of the countdown is postponed until the conditions is satisfied and you continue to count until there are a total of thirteen closes, each one greater than, or equal to, the high two bars earlier.
Countdown qualifier - The high of Countdown bar thirteen must be greater than, or equal to, the close of Countdown bar eight.
Countdown cancellation:
- A buy Setup appears. The price has rallied in the opposite direction and the market dynamic has changed.
- close below the lowest low for the current sell Setup(break of TDST for the current Setup)
- recycle occurs (new Setup in the same direction and recycle activated)

Aggressive TD Sequential – the difference is the Countdown phase. You compare high/low (not the close ) with the high/low two price bars earlier.
Aggressive Sequential always produces buy and sell signals before Sequential does.

----------------------------------------------

3. TD Combo
TD Combo is better when you have sharp directional moves, because it requires only thirteen price bars from start to finish compared to TD Sequential which needs at least 22 bars. The criteria for a Setup within TD Combo are the same with those required for a Setup within TD Sequential. The difference is that the count starts at bar 1 of the setup and not from bar 9 and TD Combo requires four conditions to be satisfied simultaneously.

Requirements for a TD Combo Buy Countdown 
- close lower or equal than the low 2 trading days earlier.
- The low of a countdown day should be less than the previous "trading day‘s" low
- The close of a countdown day should be less than the previous "trading day‘s" close
- The close of a countdowns day should be less than the previous "countdowns day‘s" close
- bars 11,12,13 each one should just close successively lower and the other rules above are not applied

Requirements for a TD Combo Sell Countdown 
- close higher or equal than the high 2 trading days earlier.
- The high of a countdown day should be greater than the previous "trading day‘s" high
- The close of a countdown day should be greater than the previous "trading day‘s" close
- The close of a countdowns day should be greater than the previous "countdowns day‘s" close
- bars 11,12,13 each one should just close successively higher and the other rules above are not applied

----------------------------------------------

Bearish Price Flip - occurs when the market records a close greater than the close four bars earlier, immediately followed by a close less than the close four bars earlier.
Bullish Price Flip - occurs when the market records a close less than the close four bars before, immediately followed by a close greater than the close four bars earlier.

TDST level – this is the highest high(usually the high of bar 1) for a buy setup or the lowest low(usually the low of bar 1) for sell setup, also called true high/low for a Setup.
- If a move cannot close above or below the TDST level of the most recently completed Setup in the opposite direction that means the momentum is weak and this is just a corrective move.
- If a move closes above/below the TDST level of the most recently completed Setup in the opposite direction that means that the momentum is strong enough and the price should then continue in that direction , and with high probability a TD Countdown will be completed before a reversal occurs.

True low/True high – is the lowest and the highest point for a setup, BUT including gaps before bar 1 and the days after the 9-th bar, qualifying for a setup bar.

Sell zone/Buy zone after finished TD Sequential – find the bar which records the highest high/lowest low for the countdown, find the range of the bar plus gaps and project it from the high/low of the bar. After finished TD Sequential/Combo the price should make a top in this zone not later than 12 price bars after bar 13 for the countdown. If the market breaks this level the signal is negated and we are witnessing renewed strength.

Setup Recycle - A second setup appears in the same direction before/on/after a Countdown - that usually means strength. The question is recycle and start a new Countdown? (there must be a price flip to divide the two setups or the first just continuous)
Compare the size of the two setups. The size is the difference between the true high and true low of a setup.
- if the second setup is equal or greater than the previous one , but less than 1.618 times its size, then Setup recycle will occur – the trend re-energize itself. Whichever Setup has the larger true range will become the active Setup.
- ignore setup recycle if the new setup is smaller or 1.618 times and more, bigger than the previous one – most probably price exhaustion area.

TD Sequential Reinforcement - 9-13-9 sequence
After a Buy Countdown the market temporarily trades higher and produces a Price Flip and subsequently a TD Buy Setup appears, this is known as a TD Sequential 9-13-9 Buy Count.
Requirements for a valid Sequential 9-13-9 Buy Count:
- The Buy Setup must not begin before or on the same price bar as the completed Buy Countdown
- The second Buy Setup must be preceded by a bullish Price Flip
- There must be no completed Sell Setup prior to the appearance of the Buy Setup.

After a Sell Countdown the market temporarily trades lower and produces a Price Flip and subsequently a TD Sell Setup appears, this is known as a TD Sequential 9-13-9 Sell Count.
Requirements for a valid Sequential 9-13-9 Sell Count:
- The Sell Setup must not begin before or on the same price bar as the completed Sell Countdown
- The second Sell Setup must be preceded by a bearish Price Flip
- There must be no completed Buy Setup prior to the appearance of the Sell Setup. 

Excel File: Download
AFL Code: Copy from Here

Option Action Tool




Option Greeks

In options trading, we use certain Greek alphabets when describing risks associated with various positions. They are delta, gamma, theta and Vega generally known as ‘Greeks’

Interactive Pay-Off Graph

Customers can specify strategies to obtain the pay-off which is indicated by a blue line. For each strategy you need to specify the strike price and premium. The pay-off graph will change dynamically based on option price change

Option Analytics

Analytics that enables users to quickly price changes in an option's price with respect to unit changes in Greek values via an intuitive point-and-click interface using put-call ratio, Option pain, Volatility smile and other proprietary tools to enrich your trading experience

Option Algos

Now using the tool you may pass the order to the trading system once you validate the pay-off using the ultra-powerful tool called Option Algos which is arriving soon

Download OptionAction Setup and Install it
Open OptionAction. It opens the registration page. Give your registration details and register. This will send you the activation key details to the registered email id.
Copy the activation key you received in your registered mail and paste it in the activation code box as shown below and press Activate
After successful license activation. It ask for user credentials. Enter the login credentials which you created during registration and press Login button.

Features
1)Neat and Cool Option Chain tool with Option Greeks, Implied Volatility, PCR Ratio (OI & Volume), Type and Search Symbols. It also computes total PCR ratio for the entire option expiry contracts or individual expiry contracts. By default it computes Total Put-Call Ratio for the entire expiry contracts.
2)Market Strategy is where one can build their option strategy either manually or with custom prebuilt templates (click on strategy button to get pre built templates). Once the strategy is built you can immediately analyze using strategy summary and payoff graph analyzer
3)OptionAction provides provision to compute and plot Option Pain. Option Pain, also known as Max Option Pain or Max Pain, is based on the theory that since most options buyers lose in options trading, the price of the underlying stock must be manipulated somehow to close during options expiration at a price that results in the most options contracts expiring out of the money
4)OptionAction comes with features like volatility cone, Volatility smile to understand which option strikes are cheaper/expensive when compared to the historical volatility
5)It also summarize the overall strategy with All in One Dashboard which gives you the bird eye view to the market condition and strategy overview.