Magazine article Modern Trader

Candlesticks in Context

Magazine article Modern Trader

Candlesticks in Context

Article excerpt

The bullishness or bearishness of a given candlestick pattern is based on the context in which it occurred. For example, hammers are more bullish after a long downtrend. Dojis are better at calling market tops than market bottoms. Dojis work best when the market is overbought.

So how can we use this information and TradeStation to develop a mechanical trading system using candlesticks?

Begin by developing a simple mechanical trading system based on the concept of going short when the market is overbought and a doji occurs. First we must develop an indicator using TradeStation to detect an overbought condition:

CanOverBought Inputs:

Price (NumericSeries),Length (Numeric);

If Price=Highest (PRICE,Length) and RSI (Price,Length)[is greater than]70 then CanOver Bought=1 else CanOverBought=0;

Because the market can remain overbought for a long period of time, using just RSI or SlowK is not good enough. Forcing the market to be at an "N" bar high combined with RSI is a much more reliable overbought indicator than using RSI or SlowK alone.

Because dojis work well at calling market tops in overbought markets, we can use our fuzzy doji shape membership function and our overbought indicator to develop a mechanical trading system. Here's how to code this in TradeStation: {The mechanical DOJI system for going short}


OPrice(Open),HPRICE(High),LPRICE (Low),CPrice(Close),OvBLen (10),HSPeriod(3);


IsDoji(0),IsOverBought(0),IsInvHam(0); IsOverBought=CanOverBought(CPrice, OvBLen); IsDoji=FuzzyDoji(OPRICE,CPRICE,15,.25,.5);

if IsOverBought=1 and IsDoji[is greater than].50 then sell("Doji") at open;

if MarketPosition (0)=-1 and BarsSinceEntry[is greater than]HSPeriod and Close[1][is greater than]Close and Close[2][is greater than]Close[1] then exitshort at open;

This system goes short when the market is overbought based on our overbought indicator and the current candlestick is a doji. …

Search by... Author
Show... All Results Primary Sources Peer-reviewed


An unknown error has occurred. Please click the button below to reload the page. If the problem persists, please try again in a little while.