Inside Candle
How to Automate strategy by Power of Stocks | Inside Candle Strategyβ
In this article, we will explore a popular trading strategy known as the Inside Candle strategy, conceptualised by the renowned trader Mr. Subasish Pani, commonly referred to as 'Power of Stocks'.Β
This strategy is highly effective and widely used by traders for its simplicity and profitability. We will not only explain the strategy in detail but also guide you on how to automate it using AlgoTest without any coding.
Free Pinescript - Inside Candle Strategyβ
To learn how to add this pinescript in TradingView, click here.
// This Pine Scriptβ’ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Β© AlgoTest
//@version=5
indicator("Inside Candle Indicator", overlay=true)
RiRe = input.float(2, title='Risk Reward Ratio')
var float insideCandleHigh = na
var float insideCandleLow = na
var int insideCandleC = 0
var int longC = 0
var int shortC = 0
var float longTar = na
var float shortTar = na
if dayofweek != dayofweek[1]
insideCandleHigh := na
insideCandleLow := na
insideCandleC := 0
longC := 0
shortC := 0
longTar := na
shortTar := na
long_exit = (close < insideCandleLow or close > longTar) and longC == 1
short_exit = (close > insideCandleHigh or close < shortTar) and shortC == 1
if short_exit or long_exit
insideCandleC := 0
shortC := 0
longC := 0
insideCandleHigh := na
insideCandleLow := na
inside_candle = high < high[1] and low > low[1] and insideCandleC == 0
if inside_candle
insideCandleC := 1
longC := 0
shortC := 0
insideCandleHigh := high[1]
insideCandleLow := low[1]
long = insideCandleC == 1 and high > insideCandleHigh and longC == 0 and shortC == 0
if long
longC := 1
longTar := high + (high - insideCandleLow)* RiRe
short = insideCandleC == 1 and low < insideCandleLow and longC == 0 and shortC == 0
if short
shortC := 1
shortTar := low - (insideCandleHigh - low) * RiRe
plotshape(inside_candle, title='Inside Candle', text = 'Baby Candle')
plotshape(long, title='Long Entry', style=shape.arrowup, location=location.abovebar, color=color.green, text='Long Entry', textcolor=color.green)
plotshape(short, title='Short Entry', style=shape.arrowdown, location=location.abovebar, color=color.green, text='Short Entry', textcolor=color.green)
plotshape(long_exit, title='Long Exit', style=shape.arrowdown, location=location.belowbar, color=color.red, text='Long Exit', textcolor=color.red)
plotshape(short_exit, title='Short Exit', style=shape.arrowdown, location=location.belowbar, color=color.red, text='Short Exit', textcolor=color.red)
alertcondition(long, 'Long Entry', 'Long Entry')
alertcondition(long_exit, 'Long Exit', 'Long Exit')
alertcondition(short, 'Short Entry', 'Short Entry')
alertcondition(short_exit, 'Short Exit', 'Short Exit')
Understanding the Inside Candle Strategyβ
Introduction to the Strategyβ
The Inside Candle strategy revolves around identifying specific candle patterns on the trading chart. It involves two main components: the mother (or alert) candle and the baby candle.
The Mother Candleβ
The mother candle is any significant candle formed on the trading chart. It doesn't matter whether it's a green or red candle. This candle sets the boundaries for the subsequent trading action.
The Baby Candleβ
The baby candle is the next candle that forms entirely within the high and low range of the mother candle. The formation of a baby candle within these boundaries signals a potential trading opportunity.
Trading Rulesβ
Long Entry: When a candle breaks above the high of the mother candle, initiate a long trade (buy).
Short Entry: When a candle breaks below the low of the mother candle, initiate a short trade (sell).
Stop Loss: The stop loss for a long trade is the low of the mother candle, and for a short trade, it's the high of the mother candle.
Risk to Reward Ratio: The recommended risk to reward ratio is 1:2, meaning for every unit of risk, the target profit is double that amount.
Practical Application on TradingViewβ
Setting Up the Strategyβ
-
Mother Candle Identification: Identify a significant candle on the trading chart.
-
Baby Candle Formation: Ensure the next candle forms entirely within the high and low range of the mother candle.
Example on TradingViewβ
Long Trade Exampleβ
-
Identify the mother candle.
-
Wait for a baby candle to form within the mother candle.
-
Once a subsequent candle breaks the high of the mother candle, initiate a long trade.