21 April 2011

Range Expansion Index REI

AFL Formula Library: DeMarker and Range Expansion Index

DeMarker

The DeMarker indicator is an attempt to overcome the shortcomings of classical overbought / oversold indicators. The DeMarker Indicator identifies potential price bottoms and tops. It accomplishes this by making price comparisons from one bar to the next and measuring the level of price demand. The formula for DeMarker is quite simple - in AFL it looks like this:

/*
** Tom Demark's DeMarker Indicator
** AFL Implementation by Tomasz Janeczko
*/

highm = IIF( H > Ref( H, -1 ), H - Ref( H, - 1), 0 );
lowm = IIF( L < Ref( L, -1 ), Ref( L, - 1 ) - L, 0 ); DeMarker = 100 * Sum( highm, 13 )/( Sum( lowm, 13 ) + Sum( highm, 13 ) ); graph0 = DeMarker; DeMarker should be interpreted as other overbought / oversold indicators such as RSI with the levels of 30 and 70. Compared to RSI it is smoother but still able to detect tops and bottoms a little bit better. Range Expansion Index The DeMark Range Expansion Index is a market-timing oscillator described in DeMark on Day Trading Options, by T.R. DeMark and T.R. Demark, Jr., McGraw Hill, 1999. The oscillator is arithmetically calculated and is designed to overcome problems with exponentially calculated oscillators, like MACD. The TD REI oscillator typically produces values of -100 to +100 with 45 or higher indicating overbought conditions and -45 or lower indicating oversold. Here is how Tom DeMark describes the calculation of Range Expansion Index: "The first step in calculating the REI is to add together the respective differences between the current day's high and the high two days earlier and the current day's low and the low two days earlier. These values will be positive or negative depending on whether the current day's high and low are greater or less than the high and low two days earlier. To prevent buying or selling prematurely into a steep price decline or advance, two additional conditions should be met to qualify a positive or negative value on a particular day: 1) either the high two days earlier must be greater than or equal to the close seven or eight days ago, or the current day's high must be greater than or equal to the low five or six days ago; 2) either the low two days earlier must be less than or equal to the close seven or eight days ago, or the current day's low must be less than or equal to the high five or six days ago. If either of these conditions are not satisfied, a zero value is assigned to that day. If they both are, the daily values (the differences between the highs and lows) are summed , and the specific value for that next day is determined. Next, all the positives and negative values are added together over a five-day period. This value is then divided by the absolute value price movement of each day over the five-day period. The numerator of the calculation can be either positive, negative or zero, because each day's value is summed for five days, but the denominator is always positive because it is only concerned with the differential price movement itself. This value is then multiplied by 100. Consequently, the REI can fluctuate between +100 and -100." Following this description I wrote the AFL formula for REI: /* ** Tom DeMark's Range Expansion Index ** AFL Implementation by Tomasz Janeczko */ HighMom = H - Ref( H, -2 ); LowMom = L - Ref( L, -2 ); Cond1 = ( H >= Ref( L,-5) OR H >= Ref( L, -6 ) );
Cond2 = ( Ref( H, -2 ) >= Ref( C, -7 ) OR Ref( H, -2 ) >= Ref( C, -8 ) );
Cond3 = ( L <= Ref( H, -5 ) OR L <= Ref( H, -6) ); Cond4 = ( Ref( L, -2 ) <= Ref( C, -7 ) OR Ref( L, -2 ) <= Ref( C, -8 ) ); Cond = ( Cond1 OR Cond2 ) AND ( Cond3 OR Cond4 ); Num = IIf( Cond, HighMom + LowMom, 0 ); Den = Abs( HighMom ) + Abs( LowMom ); TDREI = 100 * Sum( Num, 5 )/Sum( Den, 5 ) ; graph0 = TDREI; DeMark advises against trading in extreme overbought or oversold conditions indicated by six or more bars above or below the 45 thresholds. For more information on calculation and using both TD REI and DeMarker indicator check Tom DeMark's site.

06 April 2011

ZeroLag W%R for Amibroker (AFL)

Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams. Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between, of its recent trading range.The oscillator is on a negative scale, from -100 (lowest) up to 0 (highest), considered unusual since it is the obverse of the more common 0 to 100 scale found in many Technical Analysis oscillators. Although sometimes altered (by simply adding 100), this scale needn’t cause any confusion. A value of -100 is the close today at the lowest low of the past N days, and 0 is a close today at the highest high of the past N days.

Williams used a 10 trading day period and considered values below -80 as oversold and above -20 as overbought. But they were not to be traded directly, instead his rule to buy an oversold was

R reaches -100.
Five trading days pass since -100% was last reached
R rises above -95 or -85%.
or conversely to sell an overbought condition

R reaches 0.
Five trading days pass since 0% was last reached
R falls below -5 or -15%.
The timeframe can be changed for either more sensitive or smoother results. The more sensitive you make it, though, the more false signals you will get. The “close-position within a range” in the %R indicator is the same as the %K stochastic oscillator, on a different scale.



period1 = Param( "Period 1", 10, 2, 200, 1 );
period2 = Param( "Period 2", 5, 2, 200, 1 );

/*ZeroLag W%R*/
"========";

GraphXSpace = 3;

R = ((HHV(H,14) - C) /(HHV (H,14) -LLV (L,14))) *-100;

MaxGraph=10;
//Period= 10;
EMA1= EMA(R,period1);
EMA2= EMA(EMA1,period2);
Difference= EMA1 - EMA2;
ZeroLagEMA= EMA1 + Difference;
PR=100-abs(ZeroLagEMA);

Graph0=PR;

MoveAvg=MA(PR,5);


Graph1=MoveAvg;

Graph1Color=colorTan;
Graph0Style=4;
upbar= PR>= MoveAvg AND PR>= Ref(PR,-1) ;
downbar=(PR < MoveAvg) OR PR>= MoveAvg AND PR< Ref(PR,-1) ;
barcolor = IIf( downbar,colorRed, IIf( upbar, colorBrightGreen, 7));
Graph0BarColor = ValueWhen( barcolor != 0, barcolor );
Graph2=30;
Graph3=70;

Graph2Style=Graph3Style=Graph4Style=1;
Graph4Color=2;
Graph2Color=5;
Graph3Color=4;

Graph5=0;
Graph6=100;
Graph5Style=Graph6Style=1;
Graph5Color=Graph6Color=2;

Title=Name()+" < ZeroLag W%R :"+WriteVal(PR)+"%";

19 March 2011

Risk Vs Return - A Great Tutorial By David Jenyns

his following article has been extracted from David Jenyns' Trading Secrets Revealed Course and a must for traders to have a look into.

The most important rule in trading is to keep your losses small. This is the only way to ensure that if the market moves against you, you will live to trade another day – in other words, you will not suffer a loss that will take you out of the trading game. Remember, 95% of trades will lose – do your best not to be one of them.

One of the best ways to do this is to ensure that you have a fixed amount as a proportion of your account that you are willing to risk on any trade. This ensures that if you have a losing trade, you will only lose the predetermined amount.

This has been discussed in previous articles and will be discussed again in future ones as well. In general, the maximum loss should be set to no more than 1-3% of your total trading float. This seems very small but it can lead to huge gains in the long run.

Another rule is to try and estimate your target value. In other words, what is the value of the stock that you are expecting it to go to? You should only enter the trade if you expect the trade to provide more if you obtain your target value than lose if you hit your maximum loss value. Your mechanical trading system should be built with this principle in mind.

The Reward / Risk Ratio

This is a good time to introduce the principle of the reward / risk ratio. In principle, this ratio will provide you with a very important piece of information to decide whether to enter into a trade or not.

If we believe that a trade will provide three times more profit than the amount that is risked, then the reward / risk ratio is 3:1. In a similar way, if we believe that there is three times more risk to a trade than there is of the trade winning, then the reward / risk is 1:3. The example below illustrates this in more detail.

Example

We wish to purchase stock XYZ at $10 a share and we expect that the stock will increase to $11 over the space of about a month. We also place a stop level (i.e. a level that we will exit the stock) at $9.80 based on our mechanical trading system.

This means that the amount we will risk per share is $0.20 but we stand to gain approximately $1.00 per share. The reward / risk ratio is therefore 1:0.2 and this equates to 5:1. This means that there is 5 times more reward for the risk that you will incur. This trade seems like a good one to take!

Now we will not risk more than 2% of our account and that we have an account of $10,000. This means that we will not risk more than $400. As the reward/risk reward is 5:1, this means that we could stand to gain about $2,000 on this trade alone if we purchase $10,000 worth of shares!

As you will read further, it is not a good idea to put all of your money into one trade. The example above suggests that you will put all of your money into XYZ. In reality, it is a good idea to put only a fixed percentage of your money into one stock to ensure that you are not over exposed to the whims of one market alone. This will be discussed in future articles.


As another rule, the reward / risk must always be on your side – in other words, you must always have more of a chance to make more money than lose it. Some traders will insist on a reward / risk ratio of at least 3:1 before even considering the trade. They will not enter any other trade unless this ratio is met. You need to develop your own risk profile and stick to it.

Trading Glossary - Part II (P-Z)

PIVOT: A market reference point. Our most frequently used pivots are swing highs and swing lows such as the high and low of a daily bar or the highs and lows of the hourly cycles.

PREMIUM (Nifty's): When the price of an index future is trading greater than Fair Value.

RAT TRADE: An afternoon breakout trade that is made in the generally taken place after 02:15 PM.

RESISTANCE: Area where Sellers have come in the past.

ROBUST: Refers to a method or system that is profitable across a variety of markets, time frames and parameters. It is the opposite 'curve-fit' or 'optimized.'

SCALP: A Short-term trade that capitalizes on the market's smaller fluctuations.

SHAKEOUT FAKEOUT: A sharp downward move following an area of distribution that quickly reverses itself and comes back up through the distribution area.

SHORT SKIRT: The name of a very short term pattern trade taken on a one-minuteNifty futures charts. A form of pullback trade on a very short time frame.

SKIDS: Slippage or the difference between the price that a stop order was placed and the actual fill price.

SLOP AND CHOP: Action in the market when institutions are absent and liquidity is poor.

SMA: Simple Moving Average.

SPRING: Originally a Wyckoff term, is used to denote an impulsive move often associated with a test of support. See also 'Upthrust.'

STOP ORDER: An order that becomes a market order when the price touches that level.

SUPPORT: Area where buyers have stepped in the past.

SWEET STUFF: Nickname for the sugar futures.

THREE PUSHES: A characteristic pattern that occurs near important turning points. Usually three distinct 'test' of a high or low level, followed by a reversal.

TICK: Smallest increment that a price can change. 1 tick on an Nifty contract = .05 points, which is the equivalent of Rs. 2.50.

TICKS: The difference between the number of issues on the NSE that are trading UP from the last trade versus the number of issues that are trading down.

TREND DAY: A day where the market opens on one end of its range, closes on the opposite end, shows range expansion and has an increase in volume.

TRIGGER: Level at which a trade will be initiated if a market trades to that price.

TRIN: The TRIN (also know as the Trading Index and the ARMS Index) was invented by Richard Arms in the 1970s. It is calculated as follows: (Advancing issues / Declining issues) divided by (Advancing volume / Declining volume). If the index is above one, the average volume of stocks that fell on the NSE was greater than the average volume of stocks that rose. If the index is below one, then the converse is true.

UPTHRUST: Originally a Wyckoff term, is used to denote an impulsive move often associated with a test of resistance. See also 'Spring.'

VIX: VIX is a weighted measure of the implied volatility for put and call options. VIX represents the implied volatility for this hypothetical at-the-money option.

VOLATILITY: The range of the price action over N -Number of bars.

WEDGE: A low volatility point in which a triangle type formation can be drawn on the bar charts. The market can break out in EITHER direction from this formation.

WHIPSAW: Is when the market rapidly reverses its direction several times in succession.

"Z" DAY: A consolidation day that typically follows a trend day
PIVOT: A market reference point. Our most frequently used pivots are swing highs and swing lows such as the high and low of a daily bar or the highs and lows of the hourly cycles.

PREMIUM (Nifty's): When the price of an index future is trading greater than Fair Value.

RAT TRADE: An afternoon breakout trade that is made in the generally taken place after 02:15 PM.

RESISTANCE: Area where Sellers have come in the past.

ROBUST: Refers to a method or system that is profitable across a variety of markets, time frames and parameters. It is the opposite 'curve-fit' or 'optimized.'

SCALP: A Short-term trade that capitalizes on the market's smaller fluctuations.

SHAKEOUT FAKEOUT: A sharp downward move following an area of distribution that quickly reverses itself and comes back up through the distribution area.

SHORT SKIRT: The name of a very short term pattern trade taken on a one-minuteNifty futures charts. A form of pullback trade on a very short time frame.

SKIDS: Slippage or the difference between the price that a stop order was placed and the actual fill price.

SLOP AND CHOP: Action in the market when institutions are absent and liquidity is poor.

SMA: Simple Moving Average.

SPRING: Originally a Wyckoff term, is used to denote an impulsive move often associated with a test of support. See also 'Upthrust.'

STOP ORDER: An order that becomes a market order when the price touches that level.

SUPPORT: Area where buyers have stepped in the past.

SWEET STUFF: Nickname for the sugar futures.

THREE PUSHES: A characteristic pattern that occurs near important turning points. Usually three distinct 'test' of a high or low level, followed by a reversal.

TICK: Smallest increment that a price can change. 1 tick on an Nifty contract = .05 points, which is the equivalent of Rs. 2.50.

TICKS: The difference between the number of issues on the NSE that are trading UP from the last trade versus the number of issues that are trading down.

TREND DAY: A day where the market opens on one end of its range, closes on the opposite end, shows range expansion and has an increase in volume.

TRIGGER: Level at which a trade will be initiated if a market trades to that price.

TRIN: The TRIN (also know as the Trading Index and the ARMS Index) was invented by Richard Arms in the 1970s. It is calculated as follows: (Advancing issues / Declining issues) divided by (Advancing volume / Declining volume). If the index is above one, the average volume of stocks that fell on the NSE was greater than the average volume of stocks that rose. If the index is below one, then the converse is true.

UPTHRUST: Originally a Wyckoff term, is used to denote an impulsive move often associated with a test of resistance. See also 'Spring.'

VIX: VIX is a weighted measure of the implied volatility for put and call options. VIX represents the implied volatility for this hypothetical at-the-money option.

VOLATILITY: The range of the price action over N -Number of bars.

WEDGE: A low volatility point in which a triangle type formation can be drawn on the bar charts. The market can break out in EITHER direction from this formation.

WHIPSAW: Is when the market rapidly reverses its direction several times in succession.

"Z" DAY: A consolidation day that typically follows a trend day

Trading Glossary - Part II (P-Z)

PIVOT: A market reference point. Our most frequently used pivots are swing highs and swing lows such as the high and low of a daily bar or the highs and lows of the hourly cycles.

PREMIUM (Nifty's): When the price of an index future is trading greater than Fair Value.

RAT TRADE: An afternoon breakout trade that is made in the generally taken place after 02:15 PM.

RESISTANCE: Area where Sellers have come in the past.

ROBUST: Refers to a method or system that is profitable across a variety of markets, time frames and parameters. It is the opposite 'curve-fit' or 'optimized.'

SCALP: A Short-term trade that capitalizes on the market's smaller fluctuations.

SHAKEOUT FAKEOUT: A sharp downward move following an area of distribution that quickly reverses itself and comes back up through the distribution area.

SHORT SKIRT: The name of a very short term pattern trade taken on a one-minuteNifty futures charts. A form of pullback trade on a very short time frame.

SKIDS: Slippage or the difference between the price that a stop order was placed and the actual fill price.

SLOP AND CHOP: Action in the market when institutions are absent and liquidity is poor.

SMA: Simple Moving Average.

SPRING: Originally a Wyckoff term, is used to denote an impulsive move often associated with a test of support. See also 'Upthrust.'

STOP ORDER: An order that becomes a market order when the price touches that level.

SUPPORT: Area where buyers have stepped in the past.

SWEET STUFF: Nickname for the sugar futures.

THREE PUSHES: A characteristic pattern that occurs near important turning points. Usually three distinct 'test' of a high or low level, followed by a reversal.

TICK: Smallest increment that a price can change. 1 tick on an Nifty contract = .05 points, which is the equivalent of Rs. 2.50.

TICKS: The difference between the number of issues on the NSE that are trading UP from the last trade versus the number of issues that are trading down.

TREND DAY: A day where the market opens on one end of its range, closes on the opposite end, shows range expansion and has an increase in volume.

TRIGGER: Level at which a trade will be initiated if a market trades to that price.

TRIN: The TRIN (also know as the Trading Index and the ARMS Index) was invented by Richard Arms in the 1970s. It is calculated as follows: (Advancing issues / Declining issues) divided by (Advancing volume / Declining volume). If the index is above one, the average volume of stocks that fell on the NSE was greater than the average volume of stocks that rose. If the index is below one, then the converse is true.

UPTHRUST: Originally a Wyckoff term, is used to denote an impulsive move often associated with a test of resistance. See also 'Spring.'

VIX: VIX is a weighted measure of the implied volatility for put and call options. VIX represents the implied volatility for this hypothetical at-the-money option.

VOLATILITY: The range of the price action over N -Number of bars.

WEDGE: A low volatility point in which a triangle type formation can be drawn on the bar charts. The market can break out in EITHER direction from this formation.

WHIPSAW: Is when the market rapidly reverses its direction several times in succession.

"Z" DAY: A consolidation day that typically follows a trend day

Trading Glossary - Part II (G-O)

GOLF: A mechanical trade that is made in the index futures that is entered on the close of the day.

GRAIL: A trade set-up based on a pullback to the 20 period EMA after the 14 period ADX has risen above 30. Pullback in rallies are bought, and pullbacks in declines are sold short. This pattern was discussed at lenght in Street Smarts book.

IMPULSE: Increase in the market momentum. Impulse moves tend to happen in the direction of the trend. On a bar chart they have the appearance of a sharp markup or markdown.

INSTITUTIONS: Mutual funds, pension funds, banks, and large commercials.

KELTNER CHANNELS: A 'trading band' indicator that is displayed on top of price charts. Similar to Bollinger Bands but calculated differently, using true-range rather than standard deviation.

LAST CALL: Trade that setups up in the last hour of a trend day.

LOAD THE BOAT: Use full line of leverage.

MACD: An oscillator based on the difference between two moving averages. We use the difference between a 3 and 10-period simple moving average or 6 and 13-period simple moving average.

MARK UP: A Wyckoff term, used to denote the phase of the market where prices rise, from the beginning of a bull market to its top.

MARKET LEADERSHIP: Market leadership refers to those sectors and industries that are currently bringing in the best returns.

MARKET ORDER: An order to buy or sell a stock immediately at the best available current price. A market order guarantees execution.

MIT: Market-if-touched order. An order which becomes a market order if the specified price is reached.

MOC: Market-on-close order. A buy or sell order which is to be executed as a market order as close as possible to the end of the day.

MOMENTUM: The difference between the last price and the price N-numbers bar. A 2-period Rate of Change (ROC) is the same as a 2-period Momentum.

NR7: The narrowest high-low range of the past seven days.

OOPS TRADE: A term originally coined by Larry Williams which refers to a market that gaps below the previous day's low (or above the previous day's high) and then quickly reverses its direction.

OOZE: Down trending price action that slowly inches down without any upward reactions of any magnitude. One of the strongest forms of trending action.

OPENING BULGE: Period after the opening when the public has a tendency to pay too high a price.

OPENING PLAY: The markets first tendency of the day.

OUCH SETUPS: When a market Closes in the upper 75% of its range but then gaps lower the next day around the previous day's low (vice versa to the upside).

OVERHEAD SUPPLY: Are where the market had found support in the past but the price is currently trading lower.

Trading Glossary - Part I (A-F)

ADX: Trend strength oscillator originally developed J. Welles Wilder Jr. that fluctuates between 0 and 100.

BEAR FLAG: Classic bar chart pattern that occurs in a trending market, a bearish continuation pattern.

BEAR TRAP: A bear trap occurs when the market breaks below chart support, bringing traders in on the short side, then quickly reverses, trapping traders with losses.
BREADTH: The difference between the number of advancing issues and the number of declining issues on the NYSE.

BREAKOUT TRADE: A trade that occurs when the market breaks above or below some pre-define range, usually a nearby support or resistance levels such as the previous day's high or low, or the last 60 minutes high/low. Breakouts are often associated with low volatility readings.

BULL FLAG: Classic bar chart pattern that occurs in a trending market, a bullish continuation pattern.

BULL TRAP: A bull trap occurs when the market breaks above chart resistance, bringing traders in on the long side, then quickly reverses, trapping traders with losses.


CREEPER MARKET: A market that slowly creeps higher without a significant retracement. One of the strongest types of trending action that does not catch people's attention.

DIVERGENCE: A divergence is indicated when momentum fails to confirm a new low or new high in the price. Divergences usually show up best with oscillators such as the 3/10 and 5/35 MACD.

EDGE: Term used to describe when a trader has the advantage or a favorable margin. It is even better when this margin can be quantified statistically.

EMA: Exponential Moving Average. We generally use a 13 or 21-period setting.

EQUILIBRIUM LEVEL: The point at which buyers and sellers are in balance. Coincides with a neutral chart point that is often at the end of a consolidation period.

EVENT RISK: The risk that some unexpected event will cause a substantial change in the market value of a security. For example, missed earnings, lawsuits, crop failures, war, etc.

FADE: A countertrend trade.

FAIR VALUE: Fair value reflects the relationship between stock index futures and the index's current levels. It is a theoretical estimate of where the futures should be trading based on their underlying cash index with short-term interest rates and dividends factored into the calculation. Determining the fair value relationship between the Nifty futures contract and the underlying Nifty index requires adding the cost of borrowing the money to buy the Nifty stocks, while subtracting the gain these stocks pay in dividends.

FILL OR KILL: This means do it now if the stock is available in the crowd or from the specialist, otherwise kill the order altogethe

14 March 2011

Ichimoku Cloud Scanner v2.0 – AFL Code

The Demerit with the older version of Ichimoku cloud scanner is that there is too much of difference between the cloud(stop loss) and the candle which has been overcome by introducing stop loss for the trade with little modification in the trading rules.

The above nifty chart shows a trailing stop loss(black line) of 6034. But the cloud(6137) is heavily far from the Close value(5751).

Note : Black line indicate only trailing stop loss for trades but not a trailing stop loss mechanism.

Trading Rules

1)Buy on Close above the cloud
2)Sell on Close below the cloud
3)Use the Cloud as Stop loss and reverse when the cloud is very near to the candle
3)Use STPL – (Black line) as trailing stop loss when the candle is far from the cloud
4)There is nothing to do with the color of the cloud( red/green cloud it doesnt matter )
5)Red Arrows indicates sell signal i.e candle closes below the cloud
6)Green Arrows indicates Buy Signal i.e candle closes above the cloud

Where STPL is nothing but the average of Close, Span lines SP1,SP2

Few Rules that I for the shorter timeframes 15min, 30min, hourly Charts and Daily

1)Buy or Sell Trade should be taken only on the presence of the appropriate signal. Trade should not me initiated belated to the signal

2)Dont initiate trade without sufficient signals.

3)If you are in a Buy Trade/Sell Trade book the trade if you are in profit at regular intervals. Dont wait for the next signal to exit the trade

4)For 15min trade book profit if you got 20-25pts in nifty and in Hourly Charts – 50-75 points and in Daily Charts – 150-200pts without waiting for next signal.

5)Respect the trailing stop loss when you are in trade

6)If you are confused with the way you are playing – just take rest.


.................................................................


Ichimoku forecast: Ichimoku Kinko Hyo is Japanese for “one glance cloud chart.” It consists of five lines called Tenkan-sen, Kijun-sen (sen is Japanese for line), Senkou Span A, Senkou Span B and Chinkou Span. The calculation uses four different time periods which we call termT, termK, termS and termC. The Ichimoku Kinko Hyo is graphed over the closing price line. The space between the Senkou spans is called the Cloud, and is usually graphed in a hatched pattern.

The word Ichimoku can be translated to mean “a glance” or “one look”. Kinko translates into “equilibrium” or “balance”, with respect to price and time, and Hyo is the Japanese word for “chart”. Thus, Ichimoku Kinko Hyo simply means “a glance at an equilibrium chart”, providing a panoramic view of where prices are likely to go and the position one should undertake.

The Ichimoku Kinko Hyo or equilibrium chart isolates higher probability trades in the forex market. It is new to the mainstream, but has been rising incrementally in popularity among novice and experienced traders. More known for its applications in the futures and equities forums, the Ichimoku displays a clearer picture because it shows more data points, which provide a more reliable price action. The application offers multiple tests and combines three indicators into one chart, allowing the trader to make the most informed decision


Rules are simple
1)Buy if Candle closes above the cloud.
2)Sell if Candle closes below the cloud



ICHIMOKU AFL:

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();


_SECTION_BEGIN("Ichimoku Hayo Kinko");
GraphXSpace =1;
prds = Param("Standard Line Periods?", 12,5,26,1);
prds1 = Param("Turning Line Periods?", 3,3,10,1);
prds2 = Param("Delayed Line Periods?", 11,4,25,1);
prds3 = Param("Spans Periods?", 18,10,52,1);


TL = ( HHV( H, prds1) + LLV( L, prds1) )/2;
SL = ( HHV( H, prds) + LLV( L, prds) )/2;
DL = Ref( C, prds2);
Sp1 = Ref( ( SL + TL )/2, -prds2)-(C*0.003);
Sp2 = Ref( (HHV( H, prds3) + LLV(L, prds3))/2, -prds2)+(C*0.003);

STPL=(C+sp1+sp2)/3;
Plot (STPL,"STPL",ParamColor("STPL", colorBlack), styleThick);


SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
_N( Title = StrFormat( "{{NAME}} - " + SectorID( 1 ) + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", colorBlack, styleCandle | styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );

if ( ParamToggle( "Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip = StrFormat( "Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: " + NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 ) ) );
}
Buy = Cross(Close,IIf(sp1>sp2,sp1,sp2));
Sell = Cross(IIf(sp1Sp2,ParamColor("Span1 Color", ColorRGB(0,255,0)),ParamColor("Span2 Color",ColorRGB(255,104,32))),styleCloud);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ "NICK MA Swing System" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+
EncodeColor(colorLime)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n");



_SECTION_END();

Classic Seven Samurai System(Indicator)

Well, its tukai again. I will represent you a very useful Trading Style for novice like me.

Trading Style: 7 Essential Indicators You Need
When developing your own trading style, there is a danger in becoming fascinated with indicators.

The newer trader experiments with one, finds it doesn’t work so well, then switches to another, then another, etc.

The list below highlights 7 key indicators that can be woven into your trading style. You may not need to go any further than this. Stick with the 7, practice them, get to know them inside out, and get the satisfaction of developing your own successful trading style.

Indicator 1
Candlesticks –watch for a hammer, doji, head and shoulders pattern, 1-2-3 formation, double top or bottom.

Indicator 2
Trendlines –draw common sense trendlines across the highs in a downtrend or lows in an uptrend. Watch for price to break the trendline and come back and test it.


Indicator 3
MACD –Watch for a difference between the highs and lows of MACD and price. When there is divergence watch closely for a good entry point once price has shifted in the direction of the divergence.

Indicator 4
200 EMA –this indicator is an all time favorite for traders across the TA world. take note whether price is above or below the 200 EMA to give you the sense of price direction.

Indicator 5
Pivot points –take note of previous support and resistance lines as price will come back to retest these levels time and time again.

Indicator 6
Fibonacci –learn how to use this tool well and take particular note of the 50 and 62 retracement levels, especially when they coincide with trendlines or previous support/resistance.

Indicator 7
Price & Volume itself –let price prove to you where it wants to go by setting entry orders rather than market orders when entering a trade. By setting an entry order, price has to reach the target and volume confirms you specify before pulling you into the trade.

20 February 2011

Zig Zag Indicator with Valid Entry and Exit Points

The Zig Zag indicator identifies pivot points but looks into the future - (beyond the right edge of the chart) to do this. This indicator plots a dot at the pivot point and an arrow at the bar when the pivot becomes known. The price bars are colored red for a pivot downtrend, green for a pivot uptrend, and blue at the known pivot point. Three addional horizontal lines are plotted and tied to the selected bar - the current close and +/- x% from the current close. The x% is the same % used in the Zig Zag function.

Formula:
//z_ZigZagValid
// ******** CHARTING
PercentChange = 6;
mystartbar = SelectedValue(BarIndex()); // FOR GRAPHING

mystartbardate = LastValue(ValueWhen(mystartbar == BarIndex(), DateNum(),1));

InitialValue = LastValue(ValueWhen(mystartbardate == DateNum(), C , 1 ) ) ;
Temp1 = IIf(BarIndex() >= mystartbar, InitialValue, Null) ;
Plot(Temp1, " ", colorBlack,styleLine);
Plot((1+(LastValue(PercentChange)/100))*(Temp1), " ", colorGreen, styleLine) ;
Plot((1-(LastValue(PercentChange)/100))*(Temp1), " ", colorRed, styleLine) ;

ZZ = Zig(C,LastValue(PercentChange)) ;
PivotLow = Ref(IIf(Ref(ROC(ZZ,1),-1) < 0 AND ROC(ZZ,1) > 0, 1, Null),1);
PivotHigh = Ref(IIf(Ref(ROC(ZZ,1),-1) > 0 AND ROC(ZZ,1) < 0, 1, Null),1); PlotShapes( shapeCircle*PivotLow, colorGreen,0, L, -20) ; PlotShapes( shapeCircle*PivotHigh,colorRed,0,H, 20) ; Buy_Valid = IIf(C>(1+(LastValue(PercentChange)/100))*(ValueWhen(PivotLow, C,
1))
AND ROC(ZZ,1) > 0,1,0);
Sell_Valid = IIf(C<(1-(LastValue(PercentChange)/100))*(ValueWhen(PivotHigh, C, 1)) AND ROC(ZZ,1) < 0,1,0); Buy_Valid = ExRem(Buy_Valid,Sell_Valid); Sell_Valid = ExRem(Sell_Valid,Buy_Valid); PlotShapes( shapeUpArrow*Buy_Valid, colorGreen,0, L, -20); PlotShapes( shapeDownArrow*Sell_Valid, colorRed,0,H, -20) ; BarColors = IIf(BarsSince(Buy_Valid) < BarsSince(Sell_Valid) AND BarsSince(Buy_Valid)!=0, colorGreen, IIf(BarsSince(Sell_Valid) < BarsSince(Buy_Valid) AND BarsSince(Sell_Valid)!=0, colorRed, colorBlue)); Plot(C, " ", BarColors, styleBar ) ; Plot(ZZ," ", colorLightGrey,styleLine|styleThick); Plot(ZZ," ", BarColors,styleDots|styleNoLine); Title = Name() + " " + Date() + WriteIf(PivotLow, " Up Pivot ","")+WriteIf(PivotHigh," Down Pivot ","")+ WriteIf(Buy_Valid, " Buy Point ", "") + WriteIf(Sell_Valid, " Sell Point ", "") ; listing 2 _SECTION_BEGIN("Price"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) ) { ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 ))); } _SECTION_END(); _SECTION_BEGIN("ZIG"); P = ParamField( "Price field" ); change = Param("% change",5,0.1,25,0.1); z = Zig(P, change); Plot( z, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); myBuy = IIf(z > Ref(z, -1), 1, 0);
mySell = IIf(z < Ref(z, -1), 1, 0);
Buy = Cover = ExRem(myBuy, mySell);
Sell = Short = ExRem(mySell, mybuy);
Filter = Buy OR Sell;
AddColumn(Buy, "Buy", 1.0);
AddColumn(Sell, "Sell", 1.0);
_SECTION_END();

Welcome to My Domain: ZigZag Retracements.

Welcome to My Domain: ZigZag Retracements.

ZigZag Retracements.

Formula:
_SECTION_BEGIN("ZigZag Retracement");
function GetXSupport(Lo, Percentage, Back)
{
return ((BarCount - 1) - LastValue(TroughBars(Lo, Percentage,Back)));
}
function GetYSupport(Lo, Percentage, Back)
{
return (LastValue(Trough(Lo, Percentage, back)));
}

function GetXResistance(Hi, Percentage, Back)
{
return ((BarCount - 1) -LastValue(PeakBars(Hi, Percentage, Back)));
}
function GetYResistance(Hi, Percentage, Back)
{
return (LastValue(Peak(Hi, Percentage, Back)));
}

//////////////////////////////////////////////////////////////////
Per = Param("Period", .618, .1, 20, .001);
Period = Param("Look back", 10, 1, BarCount-1);
ShowRet = ParamToggle("Show Retracement values", "No|Yes",1);
Price = ParamList("Price to follow:", "Close|High|Low", 1);
if(Price=="Close") ZigP = Zig(C, per);
else if(Price=="High") ZigP = Zig(H, per);
else ZigP = Zig(L, per);

//////////////////////////////////////////////////////////////////
Plot(C, "", IIf(O>=C, colorDarkRed, colorDarkGreen), ParamStyle("Price
Style",styleBar,maskPrice));
Plot(ZigP, "Zig", colorGold, styleThick);
//////////////////////////////////////////////////////////////////

xs1 = GetXSupport(ZigP, .01, 1);
xr1 = GetXResistance(ZigP, .01, 1);
ys1 = GetYSupport(ZigP, .01, 1);
yr1 = GetYResistance(ZigP, .01, 1);

if(xs1 < xr1) { x = LineArray(xs1, ys1, BarCount - 1, LastValue(ZigP)); Down = (yr1 - LastValue(ZigP)) / (yr1 - ys1); DnBars = BarCount - 1 - xr1; Plot(x, "", colorRed, styleDots); PlotText(StrFormat("%.3f (%.0f)", Down, DnBars), (xs1 + BarCount -1)/2, (ys1+LastValue(ZigP))/2, colorWhite); } else { x = LineArray(xr1, yr1, BarCount - 1, LastValue(ZigP)); Up = (LastValue(ZigP) - ys1) / (yr1 - ys1); UpBars = BarCount - 1 - xs1; Plot(x, "", colorRed, styleDots); PlotText(StrFormat("%.3f (%.0f)", Up, UpBars), (xr1 + BarCount -1)/2, (yr1+LastValue(ZigP))/2, colorWhite); } Plot( 1, "", IIf( xs1 > xr1, colorGreen,
colorRed),styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
if(ShowRet)
for(i=2; i<=Period+1; i++)
{
xs0 = GetXSupport(ZigP, .01, i);
xs1 = GetXSupport(ZigP, .01, i-1);
ys0 = GetYSupport(ZigP, .01, i);
ys1 = GetYSupport(ZigP, .01, i-1);

xr0 = GetXResistance(ZigP, .01, i);
xr1 = GetXResistance(ZigP, .01, i-1);
yr0 = GetYResistance(ZigP, .01, i);
yr1 = GetYResistance(ZigP, .01, i-1);

xs = LineArray(xs0, ys0, xs1, ys1, 0);
Plot(xs, "", colorLightBlue, styleLine);
xr = LineArray(xr0, yr0, xr1, yr1, 0);
Plot(xr, "", colorLightBlue, styleLine);
if(xs1 < xr1)
{
Up = (yr1 - ys1) / (yr0 - ys1);
Down = (yr0 - ys1) / (yr0 - ys0);
UpBars = xr1 - xs1;
DnBars = xs1 - xr0;
}
else
{
Up = (yr1 - ys0) / (yr0 - ys0);
Down = (yr1 - ys1) / (yr1 - ys0);
UpBars = xr1 - xs0;
DnBars = xs1 - xr1;
}
PlotText(StrFormat("%.3f (%.0f)", Up, UpBars), (xr1 + xr0)/2, (yr1+yr0)/2,
colorWhite);
PlotText(StrFormat("%.3f (%.0f)", Down, DnBars), (xs1 + xs0)/2, (ys1+ys0)/2,
colorWhite);
//Plot(LineArray(xs0, ys0, BarCount-1, ys0), "", colorGreen, styleDashed);
//Plot(LineArray(xr0, yr0, BarCount-1, yr0), "", colorRed, styleDashed);

}

str = StrFormat(" (Bars to END=%.0f)\n", BarCount - 1 - BarIndex());
Title =FullName()+" ("+Name()+") - "+Date()+" - Open: "+O+", Hi: "+H+", Lo:
"+L+", Close: "+C+StrFormat(" (%.2f %.2f%%)", C-Ref(C, -1),
SelectedValue(ROC(C, 1)))+str;
WriteIf(1, "\nNote Fibonacci numbers:\nPrimary numbers: 0.618, 0.786, 1.27 and
1.618","");
WriteIf(1, "Secondary numbers: 0.382, 0.50, 1.00, 2.00, 2.24, 2.618 and
3.14","");


_SECTION_END();


ZigZag
Introduction

The ZigZag feature on SharpCharts is not an indicator per se, but rather a means to filter out smaller price movements. A ZigZag set at 10% would ignore all price movements less than 10%. Only price movements greater than 10% would be shown. Filtering out smaller movements gives chartists the ability to see the forest instead of just trees. It is important to remember that the ZigZag feature has no predictive power because it draws lines base on hindsight. Any predictive power will come from applications such as Elliott Wave, price pattern analysis or indicators. Chartists can also use the ZigZag with retracements feature to identify Fibonacci retracements and projections.
Calculation

The ZigZag is based on the chart "type". Line and dot charts, which are based on the close, will show the ZigZag based on closing prices. High-Low-Close bars (HLC), Open-High-Low-Close (OHLC) bars and candlesticks, which show the period's high-low range, will show the ZigZag based on this high-low range. A ZigZag based on the high-low range is more likely to change course than a ZigZag based on the close because the high-low range will be much larger and produce bigger swings.

The parameters box allows chartists to set the sensitivity of the ZigZag feature. A ZigZag with 5 in the parameter box will filter out all movements less than 5%. A ZigZag(10) will filter out movements less than 10%. If a stock traded from a reaction low of 100 to a high of 109 (+9%), there would not be a line because the move was less than 10%. If the stock advanced from a low of 100 to a high of 110 (+10%), there would be a line from 100 to 110. If the stock continued on to 112, this line would extend to 112 (100 to 112). The ZigZag would not reverse until the stock declined 10% or more from its high. From a high of 112, a stock would have to decline 11.2 points (or to a low of 100.8) to warrant another line. The chart below shows a QQQQ line chart with a 7% ZigZag. The early June bounce was ignored because it was less than 7% (black arrow). The two pullbacks in July were ignored because they were much less than 7% (red arrows).



Be careful with the last ZigZag line. Astute chartists will notice that the last ZigZag line is up, even though QQQQ advanced just 4.13% (43.36 to 45.15). This is just a temporary line because QQQQ has yet to reach the 7% change threshold. A move to 46.40 is needed for a gain of 7%, which would then warrant a permanent ZigZag line. Should QQQQ fail to reach the 7% threshold on this bounce and then decline below 43, this temporary line would disappear and the prior ZigZag line would continue from the early August high.


Elliott Wave Counts

The ZigZag feature can be used to filter out small moves and make Elliott Wave counts more straight-forward. The chart below shows the S&P 500 ETF with a 6% ZigZag to filter moves less than 6%. After a little trial and error, 6% was deemed the threshold of importance. An advance or decline greater than 6% was deemed significant enough to warrant a wave for an Elliott count. Keep in mind that this is just an example. The threshold and the wave count are subjective and dependent on individual preferences. Based on the 6% ZigZag, a complete cycle was identified from March 2009 until July 2010. A complete cycle consists of 8 waves, 5 up and 3 down.


Retracements and Projections

Sharpcharts users can choose between the normal "ZigZag" and "ZigZag (Retrace.)". As shown in the examples above, the normal ZigZag shows lines that move at least a specific percentage. The ZigZag (Retrace.) connects the reaction highs and lows with labels that measure the prior move. The numbers on the dotted lines reflect the difference between the current Zigzag line and the ZigZag line immediately before it. For example, the chart below shows Altera (ALTR) with the 15% ZigZag (Retrace.) feature. Three ZigZag lines have been labeled (1, 2 and 3). The dotted line connecting the low of Line 1 with the low of Line 2 shows a box with 0.638. This means Line 2 is .638 (63.8%) of Line 1. A number below 1 means the line is shorter than the prior line. The dotted line connecting the high of Line 2 with the high of Line 3 shows a box with 1.646. This means Line 3 is 1.646 (164.6%) of Line 2. A number above 1 means the line is longer than the prior line.



As you may have guessed, seeing these lines as a percentage of the prior lines makes it possible to assess Fibonacci retracements Fibonacci projections. The August decline (Line 2) retraced around 61.8% of the June-July advance (Line 1). This is a classic Fibonacci retracement. The advance from early September to early November was 1.646 times the August decline. In this sense, the ZigZag (Retrace.) can be used to project the length of an advance. Again, 1.646 is close to the Fibonacci 1.618, which is the Golden Ratio used in many projection estimates. See our ChartSchool article for more on Fibonacci retracements.
Conclusions

The ZigZag and ZigZag (Retrace.) filter price action and do not have any predictive power. The ZigZag lines simply react when prices move a certain percentage. Chartists can apply an array of technical analysis tools to the ZigZag. Chartists can perform basic trend analysis by comparing reaction highs and lows. Chartists can also overlay the ZigZag feature to look for price patterns that might not be as visible on a normal bar or line chart. The ZigZag has a way of highlighting the important movements and ignoring the noise. When using the ZigZag feature, don't forget to measure the last line to determine if it is temporary or permanent. The last ZigZag line is temporary if the current price change is less than the ZigZag parameter. The last line is permanent when the price change is greater than or equal to the ZigZag parameter.
SharpCharts

The ZigZag and ZigZag (Retrace.) can be found in SharpCharts as a price overlay in the Chart Attributes section or as an addition to an indicator. Upon selecting the Zigzag feature from the drop down box, the parameters window will appear empty. Five (5%) is the default parameter, but this can change depending on a security's price characteristics. Some securities produce too few Zigzag lines at 5% so the default is set lower (e.g. 3.75%). Some securities produce too many zigzag lines at 5% so the default is set higher (e.g. 6.25%). The Zigzag parameter can be seen in the upper left corner of the chart. Once the Zigzag feature is applied, chartists can adjust the parameter to suit their charting needs. A lower number will make the feature more sensitive, while a higher number will make it less sensitive. Click here for a live chart with the Zigzag (Retrace.) feature.






Further Study

Book: Fibonacci Ratios With Pattern Recognition - Larry Pesavento. This book details high probability patterns based on Fibonacci price retracements and projections. These setups are designed to provide good risk-reward setups for traders and investors.

Book: Elliott Wave Principle - Robert Prechter. This highly acclaimed handbook of Elliott Wave Theory is regarded as the definitive work in this area. Prechter covers Fibonacci numbers and ratios, wave analysis, time sequences and cycle analysis.

Twiggs Money Flow

Twiggs Money Flow is a derivation of Chaikin Money Flow indicator, which is in turn derived from the Accumulation Distribution line. However, Twiggs Money Flow makes two basic improvements to the Chaikin Money Flow formula:

To solve the problem with gaps, Twiggs Money Flow uses true range, rather than daily Highs minus Lows.
And, rather than a simple-moving-average-type formula, Twiggs Money Flow applies exponential smoothing, using the method employed by Welles Wilder for many of his indicators.
To know more, please go to:
http://www.incrediblecharts.com/technical/twiggs_money_flow.htm
(See also hyperlink above in "Origin" field)
Formula:
_SECTION_BEGIN("Twiggs Money Flow");
/*
Twiggs Money Flow is a derivation of Chaikin Money Flow indicator, which is in
turn derived from the Accumulation Distribution line.
However, Twiggs Money Flow makes two basic improvements to the Chaikin Money
Flow formula:
1-To solve the problem with gaps, Twiggs Money Flow uses true range, rather
than daily Highs minus Lows.
2-And, rather than a simple-moving-average-type formula, Twiggs Money Flow
applies exponential smoothing, using the method employed by Welles Wilder for
many of his indicators.
*/

periods = Param( "Periods", 21, 5, 200, 1 );
TRH=Max(Ref(C,-1),H);
TRL=Min(Ref(C,-1),L);
TR=TRH-TRL;
ADV=V*((C-TRL)-(TRH-C))/ IIf(TR==0,9999999,TR);
WV=V+(Ref(V,-1)*0);
SmV= Wilders(WV,periods);
SmA= Wilders(ADV,periods);

TMF= IIf(SmV==0,0,SmA/SmV);
Plot( TMF, _DEFAULT_NAME(), ParamColor("color", colorCycle ),
ParamStyle("Style") );
_SECTION_END();

To add color filled into add this code at the bottom before the _SECTION_END ();

=-=-=-=-=-=-=-=-=-=-

Plot( TMF, _DEFAULT_NAME(), ParamColor("color", colorCycle ), ParamStyle("Style") ); //Chris
m = IIf(SmV==0,0,SmA/SmV); //Chris
PlotOHLC( m,m,0,m, _DEFAULT_NAME(), IIf( m > 0, colorGreen, colorRed ), styleCloud); //Chris

=-=-=-=-=-=-=-=-=-=-=-

http://www.amibroker.com/guide/afl/afl_view.php?id=122

09 February 2011

TOP 8 TIPS FOR TRADERS/TRADING

"Everybody wants to be rich", and you can become rich if you follow these share trading tips. But, if you don't follow these share trading tips, you'll probably end up broke. Also, If you ever lose money on a trade, make sure you understand why. Re-read these share trading tips and figure out how many of these share trading tips were ignored.

1.) Have a Definite Plan and Stick with It - You must take time after each trading day to analyze the action of the market, consider the technical and fundamentals, then plan what you will do the next trading day - buy, sell, or hold. Before the opening of the market each day, you must recheck your analysis from the previous day. Since, something new could have occurred over night.

2.) Do not Trade Impulsively - The biggest weakness of every trader is giving in to impulse trading. Impulse trading is basically gambling and can cause you to lose the largest amount of money by invoking your emotions of fear, greed and inability to recognize you made a bad trade. Successful traders know they will make bad trades from time to time. But they never hold on stubbornly to a losing position. They try to keep their losses small.

3.) Look for Special Situations - Avoid low volume trading shares. Why waste your time and tie up your funds with inactive shares? Instead, look for shares that offer you an opportunity to gain at least 30% or more in only a few weeks. Usually, this means you must turn your attention away from certain shares you personally like and trade in shares that looks ready to move in a definite direction.

4.) Learn How to Sell Short - To make the most money from share trading you must be ready and willing to sell shares "short". Short selling is the selling of shares that the seller doesn't own. More specifically, a short sale is the sale of a security that isn't owned by the seller, but that is promised to be delivered. In fact, you can make more money faster selling short than you can by going long.

5.) Never Sell A New High - If the market keeps making new highs, there are good reasons for it. It's smarter to be "long", bet on shares rising, and go with the up trend than try to go "short", betting on shares falling, and fight against the trend. There's no way of knowing how high the market may move against you. Wait a few days for a definite indication of a reversal in trend. It might be several days or weeks.

6.) Never Buy A New Low - If the market keeps making new lows, there are good reasons for it. It's smarter to be "short", bet on shares falling, and go with the down trend than try to go "long", betting on shares rising, and fight against the trend. There's no way of knowing how low the market may move against you. Wait a few days for a definite indication of a reversal in trend. It might be several days or weeks.

7.) Trade Only with Funds You can Afford to Lose - If you can't afford to lose whatever money you have, you will find it almost impossible to win. The reason is you won't be able to follow the tips given in this article. And, if you fail to follow these tips, you probably won't make any profits.

8.) Cut Your Losses and Let Your Profits Grow - This is the most important tip. It's also the hardest to follow. But you must embrace this tip or you'll never become rich from trading. Few traders have the discipline to take small losses. If you are one of the few who can do this, you have a very good chance of becoming an elite trader. When most traders make a trade, they believe they're correct. If the market moves against them, they stubbornly hold on. They hate to admit they're wrong. Even when their loss grows larger, they refuse to take that loss and get out. They hope the market will turn around soon and prove them correct or at least move back to reduce their losses. But, more times than not, the market does not return to that level. When you place your order to buy or sell "short", you'll usually know whether you are right or wrong before the week is over. If you are wrong and the trade you made shows a loss of 20% or more, you should get out before the close of the market that day. Taking such a loss takes a lot of courage.

Finally, make sure all of the Share Trading Tips are pointing in the same direction, up or down. If your financial mentor also agrees, then you have a good chance of making a successful trade.

31 January 2011

Price Adjustment:

(Thanks and all credit goes to stockpedia)

You might have seen that day after record date, there was a drastic price fall of a particular company. This price is not fallen due to performance or any news of the company. Actually this price is adjusted according to the declared dividend(stock or cash)or right share rate. So, this type of price reduction after record date is called as "Adjustment of Price" for a share. But as we know, there are 3 types of record date. One is for AGM/dividend approval, second is for entitlement of Right Share and third one is for EGM. Normally price is adjusted in case of first two cases. Moreover, the adjustment rate will be different in case of cash/stock/right share.

Adjustment for Stock Dividend:
This adjustement occurs in case of stock dividend. Processes are as below:
1)Find the closing price: We know that no transiction occures on the record date. So, first of all, identify the closing price on day before record date. As for example, record date of Xcompany was 10th April and the last price on 9th April was 1200tk. So, you have consider the 1200tk in this case.
2)Calculate price of 100 shares: As stock dividend/right share is declared as percentage(%), it will be easier if you consider the adjustement for each 100 shares. To calculate the price of 100 shares, multiply the closing price with 100(number of shares). So, from previous example, price of 100 shares is 1200(tk)X 100(shares)= 1,20,000 tk on day-before-record date.
3)Total shares with bonus: Find out total number of shares (Main+Bonus) you will get after record date for each 100 shares. Suppose, The company declared 20% stock dividend. So your number of shares will be 100+20=120 nos if you have 100 shares on record date.
4)Calculate adjustment: Now the adjustment can be done by following formula:
Adjusted Price = Calculated Price of 100 Shares / Total Shares with Bonus
Here, (/)sign means, divided by.

From the example, we have calculated price of 100 shares is 1,20,000tk and number of shares after record date 120nos.
So, adjusted price after record date is, 1,20,000/120 = 1000tk.
You can also get our calculator from [MISC] section under drop-down menu.

Adjustement for Right Share:
1)Find the closing price: Same as 'Stock Dividend'. Please see the Adjustment for Stock Dividend.
2)Calculate price of 100 shares: Same as 'Stock Dividend'.
3)Total shares with right shares: In case of right share, if it is declared as 1R:2(1 Right share of each 2 shares), then the number will be 100+50Right=150nos. If it is declared as percentage(%), calculation will be as like as stock dividend.
4)Deduct the submitted price: To get right share, you have to deposit at least face value for the total amount of right shares you will recieved. Moreover, if company declared premium, you have to add that amount(premium)with face value for each share. From the previous point, we have calculated that you will get 50 right shares for 1R:2, Facevalue of each share is 100tk and suppose premium is 50tk. So you have to deposit 100(facevalue)+50(premium)=150tk for each right share. Total money you have to deposit for that 50 right share is 50X150tk=7500tk. Deduct this amount from the price of 100 shares (1,20,000tk - 7,500tk=1,12,500tk)
5)Calculate adjustment:
Adjusted Price = Deducted Price / Total Shares with Right Shares
Here, (/)sign means, divided by.

From the example, adjusted price is 1,12,500/150 = 750tk.
You can also get our calculator from [MISC] section under drop-down menu.

Adjustment for Cash Dividend:
1)Calulate cash amount: In case of cash dividend, you have identify how much cash you are going to get after record date. If face value of a share is 200 taka, then the price of 100 no. of shares is 100(shares)X 200(taka)= 20,000 taka. In case of 20% cash dividend, you will get 20,000tkX20%= 4,000tk for each 100 shares.
2)Calculate market price of 100 shares: If the price of each share was 1200tk on day-before-record date, then the current market price is 1200(tk)X 100(shares) = 1,20,000tk for each 100 shares.
3)Calculate adjustment:
Adjusted Price = (Current price of 100 shares - Calulated cash amount for 100 shares) / 100

From the example, current market price of 100 shares is 1,20,000tk and calculated cash amount to be recieved from 100 shares is 4,000tk.
So the adjusted price = (1,20,000tk - 4,000tk)/ 100 = 1160tk
You can also get our calculator from [MISC] section under drop-down menu.

31 December 2010

afl to calculate risk, profit and RR Ratio

First save the formulae through FORMULA EDITOR. Then click on COMMENTARY. Immediately guru chart commentary will open. After that click on formula in guruchart commentary and click on LOAD button and select the formulae where you have saved. Then change the parametres of entry, stoploss,target for the current chart. Then click on commentary. You will get results.


"Date="+Date();
Entry=10.15;
StopLoss=9.57;
Target=13.97;
"Entry="+WriteVal(Entry);
"StopLoss="+WriteVal(StopLoss);
"Target="+WriteVal(Target);
Risk=(Entry-StopLoss);
RiskPer=((Entry-StopLoss)/Entry)*100;
"Risk%="+WriteVal(RiskPer);
Profit=(Target-Entry);
ProfitPer=((Target-Entry)/Entry)*100;
"Profit%="+WriteVal(ProfitPer);
RRR=(Profit/Risk);
"RRRatio="+WriteVal(RRR);

30 December 2010

Formula name: MultiCycle 1.0

Description:

This looks at four different cyclic indicators together at one time. When three oscillators synchronize, this signals a strong buy or sell.

The white dotted line is the Volume Flow Indicator, or VFI. If the VFI is above the zero line, look for synchronized oscillators rising out of an oversold condition -- this is a good buy signal. If VFI is below zero, look for overbought conditions and short, instead.

The REI is Tom DeMark's Range Expansion Index. This is the most leading indicator included here. The DSS is a double-smoothed stochastic, good for timing and exact buy or sell point. And the IFT is the Inverse Fisher Transform function.

This indicator works well for any time frame. All it takes is a little getting used to before you become intuitive with it.

I named it the MultiCycle for lack of a better name.
Formula:

/*
MULTICYCLE 1.0
By Brian Richard
*/

/* Volume Flow Indicator */
Period = Param("VFI Period",26,26,1300,1);
Coef=0.2;
VCoef=Param("Max. vol. cutoff",2.5,2.5,50,1);
inter = log(Avg)-log(Ref(Avg,-1));
Vinter = StDev(inter,30);
Cutoff=Coef*Vinter*Close;
Vave=Ref(MA(V,Period),-1);
Vmax=Vave*Vcoef;
Vc=Min(V,VMax);
MF=Avg-Ref(Avg,-1);
VCP=IIf(MF>Cutoff,VC,IIf(MF<-Cutoff,-VC,0)); VFI1=Sum(VCP,Period)/Vave; VFI=EMA(VFI1,3); /* Double Smoothed Stochastic - DSS */ Slw = 4; Pds = 4; A = EMA((Close-LLV(Low,Pds))/(HHV(H,pds)-LLV(L,Pds)),Slw)*100; DSS = EMA((A-LLV(A,pds))/(HHV(A,Pds)-LLV(A,Pds)),Slw)*100; /* Tom DeMark's Range Expansion Index */ HighMom = H - Ref( H, -2 ); LowMom = L - Ref( L, -2 ); Cond1 = ( H >= Ref( L,-5) OR H >= Ref( L, -6 ) );
Cond2 = ( Ref( H, -2 ) >= Ref( C, -7 ) OR Ref( H, -2 ) >= Ref( C, -8 ) );
Cond3 = ( L <= Ref( H, -5 ) OR L <= Ref( H, -6) );
Cond4 = ( Ref( L, -2 ) <= Ref( C, -7 ) OR Ref( L, -2 ) <= Ref( C, -8 ) );
Cond = ( Cond1 OR Cond2 ) AND ( Cond3 OR Cond4 );
Num = IIf( Cond, HighMom + LowMom, 0 );
Den = abs( HighMom ) + abs( LowMom );
TDREI = 100 * Sum( Num, 5 )/Sum( Den, 5 ) ;

// General - purpose Inverse Fisher Transform function
function InvFisherTfm1( array1 )
{
e2y1 = exp( 2 * array1 );
return ( e2y1 - 1 )/( e2y1 + 1 );
}
function InvFisherTfm2( array2 )
{
e2y2 = exp( 2 * array2 );
return ( e2y2 - 1 )/( e2y2 + 1 );
}
function InvFisherTfm3( array3 )
{
e2y3 = exp( 2 * array3 );
return ( e2y3 - 1 )/( e2y3 + 1 );
}

function InvFisherTfm4( array4 )
{
e2y4 = exp( 2 * array4 );
return ( e2y4 - 1 )/( e2y4 + 1 );
}

Value1 = 0.1 * (DSS-55);
Value2 = WMA( Value1, 5 );

Value3 = 0.1 * ( RSI( 5 ) - 50 );
Value4 = WMA( Value3, 10 );

Value5 = 0.03 * (TDREI);
Value6 = WMA( Value5, 10 );

Value10 = VFI;
Value11 = EMA(VFI,10);

Plot( InvFisherTfm1( Value2 ), "DSS", colorDarkGreen, styleThick );
Plot( InvFisherTfm2( Value4 ), "RSI", colorBlue, styleThick );
Plot( InvFisherTfm3( Value6 ), "REI", colorRed, styleThick );
Plot( InvFisherTfm4( Value11 ), "VFI", colorWhite, styleDots );

Plot(0,"",colorDarkBlue,styleDots);
PlotGrid( 0.5 );
PlotGrid(-0.5 );

25 December 2010

Schaff's Trend Cycle - Amibroker

The Schaff Trend Cycle Indicator (STC) by Dough Schaff, was developed to improve upon the speed and accuracy of the MACD indicator when it comes to identifying trends. It uses a MACD Line (the difference between two exponential moving averages) through a reworked stochastic algorithm.

What we get is a faster cycle identifier - an great aid in identifying trend changes and finding faster entries and exits.

Schaff Trend Cycle (STC) oscillates in between 0 and 100 scale.
The 25 level is called a Buy level, the 75 - a Sell level.
The default settings for STC are (10, 23, 50).

Buy Entry:
1. While indicator stays below the 25 - the downtrend is in progress.
2. Once it crosses up above the 25 level - it's the first warning of a changing trend: place a pending Buy order above the corresponding candle on a chart.
3. Wait for the Buy order to be filled. If the order is not filled, and the price continues lower - not a problem. Keep the pending order further while observing Schaff Trend Cycle behavior and new signals.



Opposite true for Sell entries, where the indicator has to cross the 75 level down to send a signal about a trend change setup.

18 December 2010

BEAR MARKET AND STOP LOSS

Bear market,Things are quite bad brokers are tensed they are not able to reach their respective brokerage targets,Traders are feeling the heat no easy money by trading in out.

Is there any way to survive Bear market!!!!

Of course easiest would be not to trade:).

Well that's not possible.
Trader will trade

Many Traders or investors have one thing in common in thinking.
Bear market good for investment...
buying in falls would fetch good return...

Now here few valid points to discuss
how long you ready to wait..
A trader who sits in front of live charts would he be able to see his holding getting ripped off 50-80%.
Secondly,How to analyze which fall is good to buy,and which is not.

Answer would be not an easy task.
With the kind off falls we are witnessing in individual stocks Its a daunting task.

Atleast we can figure out how much we are ready to loose if the trade goes against us.
In more technical terms we need to define risk appetite.
There's a very catchy saying "A trader with out risk is like a nude girl in a boy's hostel"

You just cannot risk more than you ready to loose
Also cannot hold on to it as it keeps your money stuck in a bad trade discouraging to to get into a new trade and of course Capital gets eaten up its a cascading effect .
Lets take an example say a trader gets into a trade he makes 2k loss a amateur trader would
risk double capital to recover 2k loss+ 2k profit and may end up losing 4k.
Some one so rightly pointed out
Trading is serious Business.Accept it or forget it:)

Stop loss is best tool to define ones risk,Without stop loss its kind off gambling or wishful thinking
I came across many traders who say every time we put stop loss it gets hit.
Take this with a pinch of salt if your sl hits in more than 50% of your trades think about something else trading is not your cup of of tea.

16 December 2010



Pivot Identifier (Amibroker AFL)
Price pivots are best conceptualized with three bars. A three-bar pivot low represents support and is formed when buying pressure turns price from down to up. It is designated by a price bar with a higher low that closes above the previous bar's high, where the previous bar's low is lower than the bar that preceded it. This is true in every time frame.

A three-bar pivot high represents resistance and is formed when sellers turn price from up to down. It is seen where a price bar with a lower high closes below the previous bar's low, where the previous bar's high is higher than the bar that preceded it. Structural pivots are more easily recognized and understood when seen in a diagram or on a price chart. This is true in every time frame. (See the below mentioned figure)


Now I introduce the Pivot identifier AFL for Amibroker. You can also identify important supports and resistances in any time frame. The AFL is as follows (also an image attached):

http://2.bp.blogspot.com/_-XgafoM-JX0/TBo8PTCgomI/AAAAAAAAEr8/btyErbOnn2A/s320/Pivot+Identifier.png

_SECTION_BEGIN("Pivot Identifier");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

dist = 0.5*ATR(10);
//code and plot the pivot top
PivotTop = L < Ref(L,-1) AND H < Ref(H,-1) AND Ref(L,-1) < Ref(L,-2) AND Ref(H,-1) < Ref(H,-2) AND Ref(H,-2) > Ref(H,-3) AND Ref(L,-2) > Ref(L,-3);
PivotBottom = H > Ref(H,-1) AND L > Ref(L,-1) AND
Ref(H,-1) > Ref(H,-2) AND Ref(L,-1) > Ref(L,-2) AND
Ref(L,-2) < Ref(L,-3) AND Ref(H,-2) < Ref(H,-3);
for( i = 0; i < BarCount; i++ )
{
if( PivotTop [i] ) PlotText( "PVT", i-2, H[ i-2 ], colorGreen );
if( PivotBottom [i] ) PlotText( "PVB", i-2, L[ i-2 ] - dist[i] , colorRed );
}
_SECTION_END();

Trapped Traders - Part 1 Written by Lance Beggs




Trapped Traders - Part 1





Trapped traders are a simple concept you may wish to incorporate into your trading strategy, due to its potential to offer higher reliability trade setups.



These are price action based setups in which traders suddenly find themselves trapped in an undesirable situation, either:



a. Stuck in a losing position, desperate to get out; or

b. Stopped out of a position that then moves back in their direction, leaving them desperate to get back in.



The key in both cases is that the price action has placed traders in a position where their normal human emotional response will compel them to make a trade. We can then increase our odds by trading in the same direction as this new surge of order flow.



There are numerous ways this can present itself on a chart. We’ll look at one of my favorites today, and follow up with other trapped trader patterns in future articles.



Today’s pattern is called a 3-swing retrace.



You might also hear it referred to as an ABC correction, or an ABCD correction. It could also be considered in some cases a bull or bear flag.



We’ll start by examining a 3-swing retrace in an uptrend.


http://www.yourtradingcoach.com/images/stories/articles/3-swing-retrace-long.jpg


3-swing retrace - long







The 3 swings in the name refer to price swing AB, followed by BC and CD.



The price action is quite simple. An uptrend leading to:



- A higher high at pivot A, followed by

- A higher low at pivot B,

- A lower high at pivot C,

- A lower low at pivot D, and

- A price reversal back in the direction of the original trend.



The moving average is not essential – it’s just there to make it simpler to see the clear uptrend. And because you’re sure to be wondering, it’s a 20 period EMA. Nothing special about that, although it is a commonly used moving average. Anyway, back to the 3-swing retrace…



Why is this 3-swing retrace a powerful setup? Let’s consider the thought processes of two quite normal traders, trader A and trader B.



Trader A has been watching the uptrend rally from the sidelines, frustrated that he’s missed the move, and desperately seeking any sign of a reversal so he can get on board the next trend early. He’s not going to miss this next trade. Hope comes when he sees the price unable to breach the highs of pivot A, forming the lower high of pivot C. Trader A knows that the definition of an uptrend is a sequence of higher highs and higher lows, so the lower high is a warning sign of possible trend failure which will be confirmed by a break of the pivot low at B. He places an entry order to initiate a short position on a break of B, as is rewarded as a large red candle triggers his entry.



This is quite common thinking. Many traders will see this breakout as a quite reasonable entry point in the short direction. Others will wait for further confirmation such as a close below the pivot low at B, entering at an even worse price. The strong close below the EMA 20 is another bearish sign which should attract other traders seeking an early entry to a reversal.



In this case, the bearish order flow of the reversal traders was insufficient to overcome the force of the uptrend. Price immediately turned and smashed them, via a large green candle closing well above the pivot B breakout entry point and also above the entire red breakout candle.



No-one likes the pain of failure, especially when it comes so rapidly and decisively.



Stops will be triggered, in some cases above the red breakout candle which led to pivot D, or in other cases above the high of pivots C or A. These stop orders, which are a BUY, add to the uptrend bullish order flow, helping to propel price to new highs.



Now let’s consider Trader B. Trader B was lucky enough to catch the original trend and is sitting on a profitable long position. However, as is quite common, Trader B finds it difficult to let profits run. Recognizing the lower high at pivot C, and therefore the potential trend failure, she tightens up the trailing stop to a breakout of the last swing low, pivot B. Stopped out of her position as the red candle moved down to D she feels quite happy with herself and her brilliant tape-reading skills, until the next green candle reaffirms the dominance of the bulls and continues the uptrend without her.



Knowing that she was unfairly stopped out by those damn stop-running brokers who once again were obviously targeting her position, she now scrambles to reenter her position long, either on the close of the green candle, or the breakout above pivots C or A.



Once again, the reentry order, which is a BUY, adds to the bullish order flow helping to propel price to new highs.



All jokes about stop-running brokers aside, this is really quite common. A 3-swing retrace in an uptrend traps the bulls out of their long position, forcing them to have to get back in, and also traps the bears in a losing position, forcing them to get out. Both outcomes, trapped out of a trade, or trapped in a losing trade, lead to further bullish order flow.



Where is our entry?



As soon as we can after the large bullish green candle traps our friends Trader A and B.



Our stop loss of course should be below the pivot D, as price returning to new lows would confirm the failure of our 3-swing retrace setup. Yes, sometimes the trappers can get trapped!!!



Let’s look quickly at a second example, this time in a downtrend.





3-swing retrace - short





This example is not as technically beautiful as the previous one, but then price action patterns are rarely text-book perfect. If you look at the positioning of the labels A to D, you’ll clearly see the 3-swing retracement pattern. In this case we have a downtrend leading to…



- A lower low at pivot A, followed by

- A lower high at pivot B,

- A higher low at pivot C,

- A higher high at pivot D, and

- A price reversal back in the direction of the original trend.





The candle at pivot B offered an excellent rejection of higher prices, perhaps tempting many of the traders in a short position to tighten their stops above this candle. These positions were of course stopped out on the run up to D, trapping the bears out of their position as it then resumed its downward move.



Likewise, anyone entering long on the break above pivot B suffered through a 3 candle pause before being trapped in a drawdown situation.



Both groups of traders, those trapped in a losing long position and those trapped out of a profitable short position, will now contribute to the bearish order flow through their sell orders, as price plummets from pivot D.



We’ll look at more trapped trader patterns in future articles.



Till then, watch out for these patterns when the market is trending. Awareness of these setups can be difficult in real-time as it is quite common for traders to be searching for reversals. It’s important to remember though that trends will often continue a lot further than you can possibly expect. So don’t be too quick to change your bias. Watch counter-trend setups for possible failure opportunities, which often give a great entry back in the original trend direction.

11 December 2010

Harmonic Trading 104 (The Butterfly Pattern )

As we begin to learn about the Butterfly Pattern.

I would like to say that it is not easy. And will take some time to fully comprehend the various Fibonacci rations that makes up each Harmonic pattern.*

If you are an average Joe trader such as myself. I suggest that you find a good Harmonics indicator to help with identifying these patterns in the live market. (And connect with more experienced Harmonic traders to help you on your journey.)*

Never trade with out a stop and use good money management.

So Lets Get Started!!!!


The Butterfly Pattern


The Butterfly is considered a reversal pattern. Especially when found at significant tops (Highs) and Bottoms (Lows)


An ideal Butterfly Pattern, has a Fibonacci ratio of a 0.786 retracement of the XA leg as the B point.

That forms an AB=CD pattern of an extended C.D. leg that is 1.27 or 1.618 of the AB leg.

D. will be below X. in a Bullish Butterfly and D. will be above X. in a Bearish Butterfly.

D. is the Bread and Butter point and projection level with the greatest profit potential if the pattern holds true.* Especially when found at significant tops (Highs) and Bottoms (Lows).





This image has been resized. Click this bar to view the full image. The original image is sized 645x355.




This image has been resized. Click this bar to view the full image. The original image is sized 782x351.


GFT-Butterfly-Bullish.pdf
GFT-Butterfly-Bearish.pdf

10 December 2010

Elliot waves and Harmonic patterns

Let us have a look at an interesting situation on the Gbp/Aud pair.
The daily chart has the makings of a possible bearish Elliot wave.

As we can see, wave2 was a sharp correction to 78.6 of wave1, and it was a classic 3 wave corrective pattern.
So far, we seem to have completed the wave3 and we can expect a pullback/correction towards the upside for a wave4.
Now, price may still continue towards the down side, thus negating the Elliot wave, but we seem to have a couple of factors pointing to a possible upside correction.
The stochastic indicator has been showing a bullish regular divergence, which indicates an upside move.
We seem to looking a possible bearish Butterfly pattern in the making within the corrective wave4.
So, if the low of EW3 holds, then we can expect some moves to the upside to complete the wave4.
We can estimate the possible levels of resistance of this up move as-
a.) The reversal level “D” of the harmonic pattern.
b.) As per the rules of the Elliot wave, the wave4 should never go into the territory of wave2; hence this could also act as a resistance level. (The red line shown in the chart)

Let us have a detailed look at the harmonic pattern – the bearish butterfly

The point B has formed precisely at the 78.6 of X-A and we are looking for some more down moves to form the point ‘C’.
If price does find support at a fib level (at ‘C’) then we can expect a rally to complete the wave ‘C-D’….which should support the wave4 of the Elliot wave.
Thus the target of this bearish butterfly would be the Fib projection 127.2 of A-D…..which would be the wave5 of the Elliot wave.

When we have 2 different factors pointing to a similar setup, then it becomes a high probability trade.
But again, coming back to our ‘Mantra”.
We don’t assume anything and we don’t predict anything. We wait for price to confirm.
So, if the low of EW3 (the point A of the harmonic pattern) holds, then we can expect a corrective move up – the Elliot wave4 and subsequently the wave5.
If price breaks this low, then it becomes a bearish 123 pattern (as shown in the chart) and we can estimate the targets of this bearish move.
Sunil.
“Act….don’t React”

03 December 2010

RADAR FOUNADATION

Radar for The Foundation for Amibroker (AFL)






1 / 5 (Votes 3)
Click a star to give your rating!

This Radar afl is a combination for Southwind’s foundation.

It has heiken trend indicator as well as macd and histogram with buy sell arrows, with various indicators as bearish hook and bullish hooks warnings.

It also gives blue lines showing strength and yellow lines for change in MACD trend.it works well with SW foundation 13.

Screen shot is attached for benefit of members.

Looks like this is done by karthik M , a good work.

Here is a screenshot of how the indicator looks:
Sw_foundation_and_radar_afl

Tags: oscillator, amibroker, exploration

AFL :

// TRADING THE MACD Ver 1.0 by Karthik Marar.


_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
r4 = Param( "Wk slow", 17, 2, 200, 1 );
r5 = Param( "Wk fast", 8, 2, 200, 1 );
m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
GraphXSpace =20;

mycolor=IIf(m1<0>s1, 51,IIf(m1>0 AND m1>s1,colorLime,IIf(m1>0 AND m1Plot( m1, StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), mycolor,ParamStyle("MACD style") );
Plot( s1 ,"Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
histcolor = IIf((m1-s1)-Ref((m1-s1),-1)> 0, colorLime, colorRed );

TimeFrameSet( inDaily );// weekly
m1w=MACD(r4,r5);
s1w=Signal(r4,r5,r3);
kp=m1w-s1w;
kph=Ref(kp,-1);
TimeFrameRestore();

kw=TimeFrameExpand( kp, inDaily ); // expand for display
khw=TimeFrameExpand( kph, inDaily ); // expand for display
mw=TimeFrameExpand( m1w, inDaily ); // expand for display
sw=TimeFrameExpand( s1w, inDaily ); // expand for display

hcolor=IIf(mw<0>sw, 51,IIf(mw>0 AND mw>sw,colorLime,IIf(mw>0 AND mwgcolor=IIf(kw>khw,IIf(kw>0,colorDarkYellow,colorYellow),IIf(kw>0,colorSkyblue,colorBlue));


Plot( m1-s1, "MACD Histogram", mycolor, styleHistogram | styleThick| styleOwnScale );

_SECTION_END();

_SECTION_BEGIN("Signals");
//Zero crossover up

j1=Cross(m1,0);
PlotShapes(IIf(j1,shapeDigit1 ,Null),colorPaleGreen,0,Min(0,0),Min(0,0));
PlotShapes(IIf(j1,shapeUpArrow,Null),colorGreen,0,Min(0,0),-10);

// crossover above zero

j2=Cross(m1,s1) AND m1>0;
PlotShapes(IIf(j2,shapeDigit2 ,Null),colorYellow,0,0,0);
PlotShapes(IIf(j2,shapeUpArrow,Null),colorGreen,0,0,-10);

//Zero crossover down

j3=Cross(s1,m1) AND m1>0;
PlotShapes(IIf(j3,shapeDigit3 ,Null),colorOrange,0,Min(0,0),0);
PlotShapes(IIf(j3,shapeDownArrow,Null),colorOrange,0,Min(0,0),-10);

// crossover below zero

j4=Cross(0,m1);
PlotShapes(IIf(j4,shapeDigit3 ,Null),colorRed,0,0,0);
PlotShapes(IIf(j4,shapeDownArrow,Null),colorRed,0,0,-10);

// Histogram peak and troughs
pt=m1-s1;
Tp = Ref(pT,-1) == HHV(pT,3);
Vl = Ref(pT,-1)==LLV(pT,3);
PlotShapes(IIf(Vl AND m1>s1 ,shapeSmallCircle+ shapePositionAbove,shapeNone),IIf(m1<0 ,colorYellow,colorLime),0,0,0);
PlotShapes(IIf(Tp AND m1
//Zeroline reject bearish
zd=BarsSince(j1);
zlrd1=(zd<6 )AND j4;
PlotShapes(IIf(zlrd1,shapeStar+ shapePositionAbove,shapeNone),colorDarkRed,0,0,20);

//hooks bearish
Hu=BarsSince(j2);
Hu1=(Hu<6)AND j3;
PlotShapes(IIf(Hu1,shapeStar+ shapePositionAbove,shapeNone),colorRed,0,0,20);

//Zeroline reject Bullish
zu=BarsSince(j4);
zlru=zu<6 AND j1;
PlotShapes(IIf(zlru,shapeStar+ shapePositionAbove,shapeNone),colorPink,0,0,20);

//Hook Bullish
Hd=BarsSince(j3);
Hd1=Hd<6 AND j2;
PlotShapes(IIf(Hd1,shapeStar+ shapePositionAbove,shapeNone),colorLime,0,0,20);

//ADX related calculations
plus=EMA(PDI(14),3)>Ref(EMA(PDI(14),3),-5);
ap=EMA(ADX(14),3)>Ref(EMA(ADX(14),3),-5);
Minus=EMA(MDI(14),3)>Ref(EMA(MDI(14),3),-5);

//Power Dips - Bullish
PDIp=ADX(14)>MDI(14) AND PDI(14)>MDI(14) AND ap AND Vl AND m1>s1 AND plus ;
PlotShapes(IIf(PDIp,shapeHollowCircle+ shapePositionAbove,shapeNone),colorCustom12,0,0,0);

//power buys
pr2=ADX(14)>20 AND PDI(14)>20 AND ADX(14)>MDI(14) AND PDI(14)>MDI(14) AND plus AND j2;
PlotShapes(IIf(pr2,shapeHollowCircle+ shapePositionAbove,shapeNone),colorCustom12,0,0,20);

//Power Dips - Bearish
PDIm=ADX(14)>PDI(14) AND MDI(14)>PDI(14) AND ap AND Tp AND m1PlotShapes(IIf(PDIm,shapeHollowCircle+ shapePositionAbove,shapeNone),colorWhite,0,0,0);

//Power shorts
sr2=ADX(14)>20 AND MDI(14)>20 AND ADX(14)>PDI(14) AND MDI(14)>PDI(14) AND Minus AND j4;
PlotShapes(IIf(sr2,shapeHollowCircle+ shapePositionAbove,shapeNone),colorRed,0,0,-20);

//powerbuy2
pr2a=ADX(14)>20 AND PDI(14)>20 AND ADX(14)>MDI(14) AND PDI(14)>MDI(14) AND plus AND j1;
PlotShapes(IIf(pr2a,shapeHollowCircle+ shapePositionAbove,shapeNone),colorCustom12,0,0,20);
_SECTION_END();

_SECTION_BEGIN("Exploration");
Filter = j1 OR j2 OR j3 OR j4 OR PDIp OR PDIm OR pr2 OR sr2 ;

AddColumn(j1,"ZL UP",1);
AddColumn(J2,"MA Up",1);
AddColumn(j3,"MA DN",1);
AddColumn(J4,"ZL DN",1);
AddColumn(PDIp,"PDIP UP",1);
AddColumn(pr2,"PHK UP",1);
AddColumn(PDIm,"PDIP DN",1);
AddColumn(sr2,"PHk UP",1);
_SECTION_END();

_SECTION_BEGIN("Display the Signals");
Title = "Trading the MACD" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor() +

" - " + Date() +" - " +EncodeColor(colorLime)+ "MACD= "+WriteVal(m1)+"--"+EncodeColor(colorYellow)+
WriteIf (j1, " MACD Crossed above zero","")+
WriteIf (j2, " Bullish crossover above zero","")+
WriteIf (j4, " MACD Crossed below Zero","")+
WriteIf (j3, " Bearish crossover above zero","")+
WriteIf (PDIP, " Bullish Power Dip","")+
WriteIf (pr2, " & Power Buy","")+
WriteIf (sr2, " & Power Short","")+
WriteIf (PDIm, " Bearish Power Dip","")+
WriteIf (Hd1, " & Bullish Hook","")+
WriteIf (Hu1, " & Bearish Hook","")+
WriteIf (zlrd1, " & Bearish zeroline Reject","")+
WriteIf (zlru, " & Bullish Zeroline Reject","");
_SECTION_END();






















_SECTION_BEGIN("Earth-2");
//Copyright 9Trading.com
VAR2=(High+Low+(Close)*(2))/(4);
B = ((EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))*(38));
Plot(b, "", 4, 1+4);
bot1 = ((((-1))*(EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))+0.01)*(38));
Plot(bot1, "", 4, 1+4);
VAR22=((Close-LLV(Low,10))/(HHV(High,10)-LLV(Low,10)))*(100);
VAR33=EMA(VAR22,10);
VAR44=EMA(VAR33,10);
VAR55=(3)*(VAR33)-(2)*(VAR44);
VAR66=EMA(VAR55,5);
BridgeT = (EMA(VAR66,1));
Plot(bridget, "", IIf(bridget > Ref(bridget,-1),colorBlue,colorYellow), 1+4);
Plot(-bridget, "", IIf(bridget > Ref(bridget,-1),colorBlue,colorYellow), 1+4);

trend = (5)*(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5))-
(3)*(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3))-
EMA(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3),2);
Buy1 = Cross(trend,5);
PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ), colorGreen, layer = 0, yposition = 0, offset = 3 );
PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ),colorGreen, layer = 0, yposition = 0, offset = -4 );

VARA1=((Close>=Ref(Close,-1)) AND (Ref(Close,-1)>=Ref(Close,-2)) AND (Ref(Close,-1)<=Ref(Close,-3))
AND (Ref(Close,-2)<=Ref(Close,-3)) AND ((Ref(Close,-4)>Ref(Close,-2)) OR (Ref(Close,-4)<=Ref(Close,-2))
AND (Ref(Close,-5)>=Ref(Close,-3))) OR (Close>=Ref(Close,-1)) AND (Ref(Close,-1)<=Ref(Close,-2))
AND (Close>=Ref(Close,-2)) AND ((Ref(Close,-3)>Ref(Close,-1)) OR (Ref(Close,-3)<=Ref(Close,-1))
AND (Ref(Close,-4)>=Ref(Close,-2))));
VARA2=LLV(Low,5);
VARA3=HHV(High,5);
VARA4=EMA(((Close-VARA2)/(VARA3-VARA2))*(100),4);
VARA5=EMA((0.66699999)*(Ref(VARA4,-1))+(0.333)*(VARA4),2);
VARA6=(VARA5<24) AND (Open
Buy2 =IIf(VARA1 AND (VARA6),30,0);
Plot(Buy2, "", 8,2+4);
Plot(-Buy2, "", 8,2+4);

_N(Title = StrFormat("\\c02.{{NAME}} | {{DATE}} | {{VALUES}}")+EncodeColor(colorBrightGreen)+WriteIf(Buy2==30,"BuySignal-A","" )+EncodeColor(colorBrightGreen)+WriteIf(Buy1==1," | BuySignal-B",""));


_SECTION_BEGIN("Earth-3");
n = Param("Periods", 14, 5, 25, 1 );
var6=(2*Close+High+Low)/4;
var7=LLV(L,n);
var8=HHV(H,n);
var9=EMA((var6-var7)/(var8-var7)*100,5);
varA=EMA(0.333*Ref(var9,-1)+0.667*var9,3);
UP=Var9;
DOWN=Vara;
barcolor2=
IIf( (Ref(up,-1)>Ref(down,-1) AND Ref(up,-1)>up AND up>down )
OR (Ref(up,-1) , colorBlue,
IIf(up>down,5,4));
Plot(0,"",barcolor2,styleLine);

_SECTION_END();

_SECTION_BEGIN("Earth-1");
EB1 = Close > Ref(Close, -1) AND Ref(Close, -1) > Ref(Close, -2) AND Ref(Close, -1) <>= Ref(Close, -5) ),IIf(Ref(Close, -5) < Ref(Close, -6), 1,Ref(Close, -6) < Ref(Close, -7))));
ES1 = Close <> Ref(Close, -3) AND IIf(Ref(Close, -3) > Ref(Close, -4), 1, IIf(Ref(Close, -4) > Ref(Close, -5),Ref(Close, -1) > Ref(Close, -4) OR( Ref(Close, -2) > Ref(Close, -4) AND Ref(Close, -3) <= Ref(Close, -5) ),IIf(Ref(Close, -5) > Ref(Close, -6), 1,Ref(Close, -6) > Ref(Close, -7))));
PlotShapes( IIf( EB1, shapeHollowSmallSquare, shapeNone ), colorWhite, layer = 0, 0, 0 );
PlotShapes( IIf( ES1, shapeHollowSmallSquare, shapeNone ), colorOrange, layer = 0, 0, 0 );
_SECTION_END();

_SECTION_BEGIN("Exploration");
LastBar = Cum( 1 ) == LastValue( Cum( 1 ) );
Filter = LastBar;

pfrom = Param("Price From", 0, 0, 1000, 0.5 );
pto = Param("Price To", 1000, 0, 1000, 0.5 );
Minv = Param("Minimum Volume (K)", 500, 0, 1000, 50);
dd = Param("Decimal Digits", 1.2, 1, 1.7, 0.1 );

EB21= Buy1;
EB22=Buy2;
//Filter = Buy AND C>pfrom AND C1000*Minv;
Color = IIf(Close>Open, colorGreen, colorRed);
bcolor = IIf(Buy1 OR Buy2, colorGreen, 1);
AddTextColumn(WriteIf(EB1,"Buy",WriteIf(ES1,"Sell","")),"Earth-1",colorDefault,-1);
AddTextColumn(WriteIf(Buy1==1,"Buy-A"," "),"Earth-2a",colorDefault,-1);
AddTextColumn(WriteIf(Buy2==30,"Buy-B"," "),"Earth-2b",colorDefault,-1);
AddTextColumn(WriteIf(bridget > Ref(bridget,-1) AND Ref(bridget,-1)Ref(bridget,-2),"Sell","")),"Earth-2c",colorDefault,-1);
AddTextColumn(WriteIf(barcolor2==colorBlue,"Modarate",WriteIf(barcolor2==4,"Buy",WriteIf(barcolor2==5,"Sell",""))),"Earth-3",colorDefault,-1);
//AddColumn(Buy, "Buy" , 1.1, bcolor);
//AddColumn(O, "Open", dd, textColor = Color);
//AddColumn(C, "Close", dd, textColor = Color);
//AddColumn(V, "Volume", 1, textColor = Color);
//AddTextColumn(FullName(),"Name");
_SECTION_END();










// created by chandrakant
//modified on 120309..credit goes to of Karthik sir

/*1. Here are some observations to keep in mind that will help assure
you are in a good trending move which is detrimental to the success
of the trade moving higher before the inevitable over exhausted trend.

2 Consider only going long on the 5M if the 30M (two rows above) is also blue.

3 Consider the 1hr row as well being blue since it has an effect too.

4 The 15M row has to be blue with NO exceptions

5 The 30M row if blue has less effect on the trade as compared to the 15M row
but keep this in mind. The 30M row being blue helps the 15M row continue to stay blue.

6 The 1hr row has even less effect OR importance but it too keeps the 30M
from weakening to some minor degree.
*/
// Define label bar (x) position location

blankRightBars = 5; //insert actual blank right bars specified in Preferences
barsInView = Status("lastvisiblebarindex") - Status("firstvisiblebarindex") - blankRightBars;
Offset = Param("Offset Bar", 0.95, 0, 1, 0.01);
textOffset = BarCount - (Offset * barsInView);

_SECTION_BEGIN("default");
HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
PlotText("Heinkein 4T tf :"+Interval(2), textoffset, 41.01, colorYellow);

Color = IIf( Haopen > Haclose,4, IIf( Haopen == Haclose,colorYellow, 6));
Plot(10,"", Color, styleHistogram+styleThick|styleOwnScale|styleNoLabel, 0, 100 );
Plot( 11,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );

_SECTION_BEGIN("4");
Compress4= Param("Compression4",8,2,10,1);
TimeFrameSet(Compress4* Interval());
HaClose4 =EMA((O+H+L+C)/4,3);
HaOpen4 = AMA( Ref( HaClose4, -1 ), 0.5 );
HaHigh4 = Max( H, Max( HaClose4, HaOpen4 ) );
HaLow4 = Min( L, Min( HaClose4, HaOpen4 ) );
PlotText("Heinkein 4T tf :"+Interval(2), textoffset, 41.14, colorYellow);
TimeFrameRestore();
HAopen4f=TimeFrameExpand( Haopen4, Compress4* Interval());
Haclose4f=TimeFrameExpand( Haclose4, Compress4* Interval());
HaHigh4f=TimeFrameExpand( Hahigh4, Compress4* Interval());
HaLow4f=TimeFrameExpand( Halow4, Compress4* Interval());
Color4 = IIf( Haopen4f > Haclose4f,4, IIf( Haopen4f == Haclose4f ,colorYellow, 6));
Plot(10,"", Color4, styleHistogram+styleThick|styleOwnScale|styleNoLabel, 0, 100 );
Plot( 41,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );
_N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}} "+_DEFAULT_NAME()+" : {{OHLCX}} {{VALUES}}" );



My Blog List

Total Pageviews

Search This Blog

Followers