467 lines
27 KiB
Plaintext
467 lines
27 KiB
Plaintext
///////////////////////////////////////////////////////
|
||
//
|
||
// SaherElm IT Center XTrade XCRT_IND Indicator
|
||
// ---------------------------------------------
|
||
// Candle Recognition Types
|
||
//
|
||
// it is an indicator which going to find candle types
|
||
// and provides some usefull info based on them.
|
||
//
|
||
//
|
||
// Maintainer:
|
||
// ------------
|
||
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
||
//
|
||
//////////////////////////////////////////////////////
|
||
|
||
//
|
||
//@version=5
|
||
indicator(title="SaherElm X-Candle Recognition Type Indicator", shorttitle = "XS_CRT_IND", overlay = true)
|
||
|
||
//
|
||
// START Inputs ....
|
||
//
|
||
//
|
||
CRTShowCandleTypeLabel = input.bool(defval = false, title = "Show Recognized Candle Types Labels")
|
||
|
||
//
|
||
CRTShowCandleTypeShape = input.bool(defval = true, title = "Show Recognized Candle Types Shapes")
|
||
|
||
//
|
||
var CRTTrendRule1 = "Price 50 SMA"
|
||
var CRTTrendRule2 = "50 SMA and 200 SMA"
|
||
var CRTTrendRule = input.string(CRTTrendRule1, "Trend Detection Rule", options=[CRTTrendRule1, CRTTrendRule2, "None"])
|
||
//
|
||
// END Inputs ....
|
||
//
|
||
|
||
//
|
||
// START Functions ....
|
||
//
|
||
//
|
||
// Determines candle is Green or not ...
|
||
isGreenCandle() =>
|
||
if close > open
|
||
true
|
||
else
|
||
false
|
||
|
||
//
|
||
// Retreive Lower Shadow of Candle ...
|
||
lowerShadow() =>
|
||
if isGreenCandle()
|
||
open - low
|
||
else
|
||
close - low
|
||
|
||
//
|
||
// Retrieve Upper Shadow of Candle ...
|
||
upperShadow() =>
|
||
if isGreenCandle()
|
||
high - close
|
||
else
|
||
high - open
|
||
|
||
//
|
||
// Retrieve Real Body Size of Candle ...
|
||
realBody() =>
|
||
math.abs(close - open)
|
||
|
||
//
|
||
// END Functions ....
|
||
//
|
||
|
||
//
|
||
// START Calculations ....
|
||
//
|
||
CRTUpTrend = true
|
||
CRTDownTrend = true
|
||
|
||
//
|
||
// Trend Rule 1 ...
|
||
if CRTTrendRule == CRTTrendRule1
|
||
CRTPriceAvg = ta.sma(close, 50)
|
||
CRTDownTrend := close < CRTPriceAvg
|
||
CRTUpTrend := close > CRTPriceAvg
|
||
|
||
//
|
||
// Trend Rule 2 ...
|
||
if CRTTrendRule == CRTTrendRule2
|
||
CRTSma200 = ta.sma(close, 200)
|
||
CRTSma50 = ta.sma(close, 50)
|
||
CRTDownTrend := close < CRTSma200 and CRTSma50 < CRTSma200
|
||
CRTUpTrend := close > CRTSma200 and CRTSma50 > CRTSma200
|
||
|
||
//
|
||
// ema depth for bodyAvg ...
|
||
CRTLen = 14
|
||
|
||
//
|
||
// size of shadows ...
|
||
CRTShadowPercent = 5.0
|
||
|
||
//
|
||
CRTShadowEqualsPercent = 100.0
|
||
CRTDojiBodyPercent = 5.0
|
||
|
||
//
|
||
// shows the number of times the shadow dominates the candlestick body
|
||
CRTFactor = 2.0
|
||
|
||
//
|
||
CRTBodyHi = math.max(close, open)
|
||
CRTBodyLo = math.min(close, open)
|
||
|
||
//
|
||
CRTBody = CRTBodyHi - CRTBodyLo
|
||
CRTBodyAvg = ta.ema(CRTBody, CRTLen)
|
||
|
||
//
|
||
CRTLongBody = CRTBody > CRTBodyAvg
|
||
CRTSmallBody = CRTBody < CRTBodyAvg
|
||
|
||
//
|
||
CRTUpShadow = high - CRTBodyHi
|
||
CRTDnShadow = CRTBodyLo - low
|
||
CRTHasUpShadow = CRTUpShadow > CRTShadowPercent / 100 * CRTBody
|
||
CRTHasDnShadow = CRTDnShadow > CRTShadowPercent / 100 * CRTBody
|
||
|
||
//
|
||
CRTWhiteBody = open < close
|
||
CRTBlackBody = open > close
|
||
CRTRange = high-low
|
||
|
||
//
|
||
CRTBodyMiddle = CRTBody / 2 + CRTBodyLo
|
||
CRTIsInsideBar = CRTBodyHi[1] > CRTBodyHi and CRTBodyLo[1] < CRTBodyLo
|
||
CRTIsDojiBody = CRTRange > 0 and CRTBody <= CRTRange * CRTDojiBodyPercent / 100
|
||
CRTShadowEquals = CRTUpShadow == CRTDnShadow or (math.abs(CRTUpShadow - CRTDnShadow) / CRTDnShadow * 100) < CRTShadowEqualsPercent and (math.abs(CRTDnShadow - CRTUpShadow) / CRTUpShadow * 100) < CRTShadowEqualsPercent
|
||
|
||
//
|
||
CRTDoji = CRTIsDojiBody and CRTShadowEquals
|
||
|
||
//
|
||
CRTOAbandonedBaby = CRTUpTrend[2] and CRTWhiteBody[2] and CRTIsDojiBody[1] and high[2] < low[1] and CRTBlackBody and low[1] > high
|
||
|
||
//
|
||
CRTOEngulfing = CRTUpTrend and CRTBlackBody and CRTLongBody and CRTWhiteBody[1] and CRTSmallBody[1] and close <= open[1] and open >= close[1] and (close < open[1] or open > close[1])
|
||
|
||
//
|
||
CRTOEveningStar = CRTLongBody[2] and CRTSmallBody[1] and CRTLongBody ? CRTUpTrend and CRTWhiteBody[2] and CRTBodyLo[1] > CRTBodyHi[2] and CRTBlackBody and CRTBodyLo <= CRTBodyMiddle[2] and CRTBodyLo > CRTBodyLo[2] and CRTBodyLo[1] > CRTBodyHi ? true : false : false
|
||
|
||
//
|
||
CRTGravestoneDoji = CRTIsDojiBody and CRTDnShadow <= CRTBody
|
||
|
||
//
|
||
CRTOHangingMan = CRTSmallBody and CRTBody > 0 and CRTBodyLo > hl2 and CRTDnShadow >= CRTFactor * CRTBody and not CRTHasUpShadow ? CRTUpTrend ? true : false : false
|
||
|
||
//
|
||
CRTHarami = CRTLongBody[1] and CRTWhiteBody[1] and CRTUpTrend[1] and CRTIsDojiBody and CRTIsInsideBar
|
||
|
||
//
|
||
CRTMarubozuShadowPercent = 5.0
|
||
CRTMarubozu = CRTLongBody and CRTUpShadow <= CRTMarubozuShadowPercent / 100 * CRTBody and CRTDnShadow <= CRTMarubozuShadowPercent / 100 * CRTBody
|
||
CRTMarubozuWhite = CRTMarubozu and CRTWhiteBody
|
||
CRTMarubozuBlack = CRTMarubozu and CRTBlackBody
|
||
CRTKicking = CRTMarubozuWhite[1] and CRTMarubozuBlack and low[1] > high
|
||
|
||
//
|
||
CRTLongShadowPercent = 75.0
|
||
CRTLongUpperShadow = CRTUpShadow > CRTRange / 100 * CRTLongShadowPercent
|
||
|
||
//
|
||
CRTOShootingStar = CRTSmallBody and CRTBody > 0 and CRTBodyHi < hl2 and CRTUpShadow >= CRTFactor * CRTBody and not CRTHasDnShadow ? CRTUpTrend ? true : false : false
|
||
|
||
//
|
||
CRT3BCrwShadowPercent = 5.0
|
||
CRT3BCrwHaveNotDnShadow = CRTRange * CRT3BCrwShadowPercent / 100 > CRTDnShadow
|
||
|
||
//
|
||
CRTOThreeBlackCrows = CRTLongBody and CRTLongBody[1] and CRTLongBody[2] ? CRTBlackBody and CRTBlackBody[1] and CRTBlackBody[2] ? close < close[1] and close[1] < close[2] and open > close[1] and open < open[1] and open[1] > close[2] and open[1] < open[2] and CRT3BCrwHaveNotDnShadow and CRT3BCrwHaveNotDnShadow[1] and CRT3BCrwHaveNotDnShadow[2] : false : false
|
||
|
||
//
|
||
CRT3Dojis = CRTDoji[2] and CRTDoji[1] and CRTDoji
|
||
CRTBodyGapUp = CRTBodyHi[1] < CRTBodyLo
|
||
CRTBodyGapDn = CRTBodyLo[1] > CRTBodyHi
|
||
CRTTriStar = CRT3Dojis and CRTUpTrend[2] and CRTBodyGapUp[1] and CRTBodyGapDn
|
||
|
||
//
|
||
CRTOAbandonedBaby1 = CRTDownTrend[2] and CRTBlackBody[2] and CRTIsDojiBody[1] and low[2] > high[1] and CRTWhiteBody and high[1] < low
|
||
|
||
//
|
||
CRTDragonflyDoji1 = CRTIsDojiBody and CRTUpShadow <= CRTBody
|
||
|
||
//
|
||
CRTOEngulfing1 = CRTDownTrend and CRTWhiteBody and CRTLongBody and CRTBlackBody[1] and CRTSmallBody[1] and close >= open[1] and open <= close[1] and ( close > open[1] or open < close[1] )
|
||
|
||
//
|
||
CRTOHammer1 = CRTSmallBody and CRTBody > 0 and CRTBodyLo > hl2 and CRTDnShadow >= CRTFactor * CRTBody and not CRTHasUpShadow ? CRTDownTrend ? true : false : false
|
||
|
||
//
|
||
CRTHarami1 = CRTLongBody[1] and CRTBlackBody[1] and CRTDownTrend[1] and CRTIsDojiBody and CRTIsInsideBar
|
||
|
||
//
|
||
CRTKicking1 = CRTMarubozuBlack[1] and CRTMarubozuWhite and high[1] < low
|
||
|
||
//
|
||
CRTOInvertedHammer = CRTSmallBody and CRTBody > 0 and CRTBodyHi < hl2 and CRTUpShadow >= CRTFactor * CRTBody and not CRTHasDnShadow ? CRTDownTrend ? true : false : false
|
||
|
||
//
|
||
CRTLongLowerShadow1 = CRTDnShadow > CRTRange / 100 * CRTLongShadowPercent
|
||
|
||
//
|
||
CRTMarubozuWhite1 = CRTMarubozu and CRTWhiteBody
|
||
|
||
//
|
||
CRTOMorningStar1 = CRTLongBody[2] and CRTSmallBody[1] and CRTLongBody ? CRTDownTrend and CRTBlackBody[2] and CRTBodyHi[1] < CRTBodyLo[2] and CRTWhiteBody and CRTBodyHi >= CRTBodyMiddle[2] and CRTBodyHi < CRTBodyHi[2] and CRTBodyHi[1] < CRTBodyLo ? true : false : false
|
||
|
||
//
|
||
CRT3WSldShadowPercent = 5.0
|
||
CRT3WSldHaveNotUpShadow = CRTRange * CRT3WSldShadowPercent / 100 > CRTUpShadow
|
||
|
||
//
|
||
CRTOThreeWhiteSoldiers = CRTLongBody and CRTLongBody[1] and CRTLongBody[2] ? CRTWhiteBody and CRTWhiteBody[1] and CRTWhiteBody[2] ? close > close[1] and close[1] > close[2] and open < close[1] and open > open[1] and open[1] < close[2] and open[1] > open[2] and CRT3WSldHaveNotUpShadow and CRT3WSldHaveNotUpShadow[1] and CRT3WSldHaveNotUpShadow[2] ? true : false : false : false
|
||
|
||
//
|
||
CRTTriStar1 = CRT3Dojis and CRTDownTrend[2] and CRTBodyGapDn[1] and CRTBodyGapUp
|
||
|
||
//
|
||
CRTDragonflyDoji = CRTIsDojiBody and CRTUpShadow <= CRTBody
|
||
|
||
//
|
||
CRTSpinningTopPercent = 34.0
|
||
CRTIsSpinningTop = CRTDnShadow >= CRTRange / 100 * CRTSpinningTopPercent and CRTUpShadow >= CRTRange / 100 * CRTSpinningTopPercent and not CRTIsDojiBody
|
||
CRTSpinningTopBlack = CRTIsSpinningTop and CRTBlackBody
|
||
|
||
//
|
||
CRTSpinningTopWhite = CRTIsSpinningTop and CRTWhiteBody
|
||
|
||
//
|
||
var bullishColor = color.lime
|
||
var bullishShape = shape.arrowup
|
||
|
||
//
|
||
var bearishColor = color.red
|
||
var bearishShape = shape.arrowdown
|
||
|
||
//
|
||
var neutralColor = color.gray
|
||
var neutralShape = shape.circle
|
||
//
|
||
// END Calculations ....
|
||
//
|
||
|
||
//
|
||
// START Plots ....
|
||
//
|
||
|
||
/////////////////
|
||
// Bearish ...
|
||
/////////////////
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOEngulfing : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTOEngulfing and CRTShowCandleTypeLabel
|
||
var tt = "Engulfing\nAt the end of a given uptrend, a reversal pattern will most likely appear. During the first day, this candlestick pattern uses a small body. It is then followed by a day where the candle body fully overtakes the body from the day before it and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to fully overtake the range (high to low), rather only the open and the close."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="BE", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOEveningStar : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTOEveningStar and CRTShowCandleTypeLabel
|
||
var tt = "Evening Star\nThis candlestick pattern is bearish and continues an uptrend with a long-bodied, green candle day. It is then followed by a gapped and small-bodied candle day, and concludes with a downward close. The close would be below the first day’s midpoint."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="ES", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTGravestoneDoji : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTGravestoneDoji and CRTShowCandleTypeLabel
|
||
var tt = "Gravestone Doji\nWhen a doji is at or is close to the day’s low point, a doji line will develop."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="GD", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOHangingMan : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTOHangingMan and CRTShowCandleTypeLabel
|
||
var tt = "Hanging Man\nWhen a specified security notably moves lower after the open, but continues to rally to close above the intraday low, a Hanging Man candlestick will form. The candlestick will resemble a square, attached to a long stick-like figure. It is referred to as a Hanging Man if the candlestick forms during an advance."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="HM", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTHarami : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTHarami and CRTShowCandleTypeLabel
|
||
var tt = "Harami\nThis is a two-day candlestick pattern with a small, red-bodied candle that is entirely encompassed within the range that was once a green-bodied candle."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="BH", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTKicking : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTKicking and CRTShowCandleTypeLabel
|
||
var tt = "Kicking\nA bearish kicking pattern will occur, subsequently signaling a reversal for a new downtrend. The first day candlestick is a bullish marubozu. The second day gaps down extensively and opens below the opening price of the day before. There is a gap between day one and two’s bearish candlesticks."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="K", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTLongUpperShadow : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTLongUpperShadow and CRTShowCandleTypeLabel
|
||
var tt = "Long Upper Shadow\nTo indicate buyer domination of the first part of a session, candlesticks will present with long upper shadows, as well as short lower shadows, consequently raising bidding prices."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="LUS", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTMarubozuBlack : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTMarubozuBlack and CRTShowCandleTypeLabel
|
||
var tt = "Marubozu Black\nThis is a candlestick that has no shadow, which extends from the red-bodied candle at the open, the close, or even at both. In Japanese, the name means “close-cropped” or “close-cut.” The candlestick can also be referred to as Bald or Shaven Head."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="MB", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOShootingStar : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTOShootingStar and CRTShowCandleTypeLabel
|
||
var tt = "Shooting Star\nThis single day pattern can appear during an uptrend and opens high, while it closes near its open. It trades much higher as well. It is bearish in nature, but looks like an Inverted Hammer."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="SS", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOThreeBlackCrows : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTOThreeBlackCrows and CRTShowCandleTypeLabel
|
||
var tt = "Three Black Crows\nThis is a bearish reversal pattern that consists of three long, red-bodied candles in immediate succession. For each of these candles, each day opens within the body of the day before and closes either at or near its low."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="3BC", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTTriStar : na, style = bearishShape, size = size.tiny, location = location.belowbar, color = bearishColor, editable = false)
|
||
if CRTTriStar and CRTShowCandleTypeLabel
|
||
var tt = "Tri-Star\nThis particular pattern can form when three doji candlesticks appear in immediate succession at the end of an extended uptrend. The first doji candle marks indecision between bull and bear. The second doji gaps in the direction of the leading trend. The third changes the attitude of the market once the candlestick opens in the direction opposite to the trend. Each doji candle has a shadow, all comparatively shallow, which signify an interim cutback in volatility."
|
||
label.new(bar_index, low, yloc=yloc.abovebar, text="3S", style=label.style_label_down, color = bearishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
/////////////////
|
||
// Bullish ...
|
||
/////////////////
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOAbandonedBaby1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTOAbandonedBaby1 and CRTShowCandleTypeLabel
|
||
var tt = "Abandoned Baby\nThis candlestick pattern is quite rare as far as reversal patterns go. The first of the pattern is a large down candle. Next comes a doji candle that gaps below the candle before it. The doji candle is then followed by another candle that opens even higher and swiftly moves to the upside."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="AB", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTDragonflyDoji1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTDragonflyDoji1 and CRTShowCandleTypeLabel
|
||
var tt = "Dragonfly Doji\nSimilar to other Doji days, this particular Doji also regularly appears at pivotal market moments. This is a specific Doji where both the open and close price are at the high of a given day."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="DD", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOEngulfing1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTOEngulfing1 and CRTShowCandleTypeLabel
|
||
var tt = "Engulfing\nAt the end of a given downward trend, there will most likely be a reversal pattern. To distinguish the first day, this candlestick pattern uses a small body, followed by a day where the candle body fully overtakes the body from the day before, and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to completely overtake the range (high to low), rather only the open and the close."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="BE", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOHammer1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTOHammer1 and CRTShowCandleTypeLabel
|
||
var tt = "Hammer\nHammer candlesticks form when a security moves lower after the open, but continues to rally into close above the intraday low. The candlestick that you are left with will look like a square attached to a long stick-like figure. This candlestick is called a Hammer if it happens to form during a decline."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="H", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTHarami1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTHarami1 and CRTShowCandleTypeLabel
|
||
var tt = "Harami\nThis two-day candlestick pattern consists of a small-bodied green candle that is entirely encompassed within the range of what was once a red-bodied candle."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="BH", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTKicking1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTKicking1 and CRTShowCandleTypeLabel
|
||
var tt = "Kicking\nThe first day candlestick is a bearish marubozu candlestick with next to no upper or lower shadow and where the price opens at the day’s high and closes at the day’s low. The second day is a bullish marubozu pattern, with next to no upper or lower shadow and where the price opens at the day’s low and closes at the day’s high. Additionally, the second day gaps up extensively and opens above the opening price of the day before. This gap or window, as the Japanese call it, lies between day one and day two’s bullish candlesticks."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="K", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOInvertedHammer : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTOInvertedHammer and CRTShowCandleTypeLabel
|
||
var tt = "Inverted Hammer\nIf in a downtrend, then the open is lower. When it eventually trades higher, but closes near its open, it will look like an inverted version of the Hammer Candlestick. This is a one-day bullish reversal pattern."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="IH", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTLongLowerShadow1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTLongLowerShadow1 and CRTShowCandleTypeLabel
|
||
var tt = "Long Lower Shadow\nTo indicate seller domination of the first part of a session, candlesticks will present with long lower shadows and short upper shadows, consequently lowering prices."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="LLS", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTMarubozuWhite1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTMarubozuWhite1 and CRTShowCandleTypeLabel
|
||
var tt = "Marubozu White\nA Marubozu White Candle is a candlestick that does not have a shadow that extends from its candle body at either the open or the close. Marubozu is Japanese for “close-cropped” or “close-cut.” Other sources may call it a Bald or Shaven Head Candle."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="MW", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOMorningStar1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTOMorningStar1 and CRTShowCandleTypeLabel
|
||
var tt = "Morning Star\nA three-day bullish reversal pattern, which consists of three candlesticks will look something like this: The first being a long-bodied red candle that extends the current downtrend. Next comes a short, middle candle that gaps down on the open. After comes a long-bodied green candle, which gaps up on the open and closes above the midpoint of the body of the first day."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="MS", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTOThreeWhiteSoldiers : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTOThreeWhiteSoldiers and CRTShowCandleTypeLabel
|
||
var tt = "Three White Soldiers\nThis bullish reversal pattern is made up of three long-bodied, green candles in immediate succession. Each one opens within the body before it and the close is near to the daily high."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="3WS", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTTriStar1 : na, style = bullishShape, size = size.tiny, location = location.belowbar, color = bullishColor, editable = false)
|
||
if CRTTriStar1 and CRTShowCandleTypeLabel
|
||
var tt = "Tri-Star\nA bullish TriStar candlestick pattern can form when three doji candlesticks materialize in immediate succession at the tail-end of an extended downtrend. The first doji candle marks indecision between bull and bear. The second doji gaps in the direction of the leading trend. The third changes the attitude of the market once the candlestick opens in the direction opposite to the trend. Each doji candle has a shadow, all comparatively shallow, which signify an interim cutback in volatility."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="3S", style=label.style_label_up, color = bullishColor, textcolor=color.white, tooltip = tt)
|
||
|
||
/////////////////
|
||
// Neutral ...
|
||
/////////////////
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTDoji : na, style = neutralShape, size = size.tiny, location = location.belowbar, color = neutralColor, editable = false)
|
||
if CRTDoji and not CRTDragonflyDoji and not CRTGravestoneDoji and CRTShowCandleTypeLabel
|
||
var tt = "Doji\nWhen the open and close of a security are essentially equal to each other, a doji candle forms. The length of both upper and lower shadows may vary, causing the candlestick you are left with to either resemble a cross, an inverted cross, or a plus sign. Doji candles show the playout of buyer-seller indecision in a tug-of-war of sorts. As price moves either above or below the opening level during the session, the close is either at or near the opening level."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="D", style=label.style_label_center, color = neutralColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTSpinningTopBlack : na, style = neutralShape, size = size.tiny, location = location.belowbar, color = neutralColor, editable = false)
|
||
if CRTSpinningTopBlack and CRTShowCandleTypeLabel
|
||
var tt = "Spinning Top Black\nBlack spinning tops are candlestick lines that are small, red-bodied, and possess shadows (upper and lower) that end up exceeding the length of candle bodies. They often signal indecision."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="STB", style=label.style_label_center, color = neutralColor, textcolor=color.white, tooltip = tt)
|
||
|
||
//
|
||
plotshape(series = CRTShowCandleTypeShape ? CRTSpinningTopWhite : na, style = neutralShape, size = size.tiny, location = location.belowbar, color = neutralColor, editable = false)
|
||
if CRTSpinningTopWhite and CRTShowCandleTypeLabel
|
||
var tt = "Spinning Top White\nWhite spinning tops are candlestick lines that are small, green-bodied, and possess shadows (upper and lower) that end up exceeding the length of candle bodies. They often signal indecision between buyer and seller."
|
||
label.new(bar_index, low, yloc=yloc.belowbar, text="STW", style=label.style_label_center, color = neutralColor, textcolor=color.white, tooltip = tt)
|
||
//
|
||
// END Plots ....
|
||
//
|
||
|
||
//
|
||
// START Alerts ...
|
||
//
|
||
alertcondition(CRTOEngulfing, title = "Engulfing")
|
||
alertcondition(CRTOEveningStar, title = "Evening Star")
|
||
alertcondition(CRTGravestoneDoji, title = "Gravestone Doji")
|
||
alertcondition(CRTOHangingMan, title = "Hanging Man")
|
||
alertcondition(CRTHarami, title = "Harami")
|
||
alertcondition(CRTKicking, title = "Kicking")
|
||
alertcondition(CRTLongUpperShadow, title = "Long Upper Shadow")
|
||
alertcondition(CRTMarubozuBlack, title = "Marubozu Black")
|
||
alertcondition(CRTOShootingStar, title = "Shooting Star")
|
||
alertcondition(CRTOThreeBlackCrows, title = "Three Black Crows")
|
||
alertcondition(CRTTriStar, title = "Tri-Star")
|
||
alertcondition(CRTOAbandonedBaby1, title = "Abandoned Baby")
|
||
alertcondition(CRTDragonflyDoji1, title = "Dragonfly Doji")
|
||
alertcondition(CRTOEngulfing1, title = "Engulfing")
|
||
alertcondition(CRTOHammer1, title = "Hammer")
|
||
alertcondition(CRTHarami1, title = "Harami")
|
||
alertcondition(CRTKicking1, title = "Kicking")
|
||
alertcondition(CRTOInvertedHammer, title = "Inverted Hammer")
|
||
alertcondition(CRTLongLowerShadow1, title = "Long Lower Shadow")
|
||
alertcondition(CRTMarubozuWhite1, title = "Marubozu White")
|
||
alertcondition(CRTOMorningStar1, title = "Morning Star")
|
||
alertcondition(CRTOThreeWhiteSoldiers, title = "Three White Soldiers")
|
||
alertcondition(CRTTriStar1, title = "Tri-Star")
|
||
alertcondition(CRTDoji and not CRTDragonflyDoji and not CRTGravestoneDoji, title = "Doji")
|
||
alertcondition(CRTSpinningTopBlack, title = "Spinning Top Black")
|
||
alertcondition(CRTSpinningTopWhite, title = "Spinning Top White")
|
||
//
|
||
// END Alerts ...
|
||
//
|
||
|
||
//////////////////////////////////////////////////////
|
||
// TODOS:
|
||
// -------
|
||
// - []
|
||
//////////////////////////////////////////////////////
|