-
Notifications
You must be signed in to change notification settings - Fork 11
/
CandlestickKicker.pine
26 lines (22 loc) · 1.89 KB
/
CandlestickKicker.pine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FxCloudTrader
//@version=5
indicator("Candlestick - Kicker Pattern", shorttitle = 'Kicker', overlay = true)
bool enableKicker = input.bool(true, 'Enable Candlestick Kicker Pattern')
_bodyPencLeft = input.int(0, 'Minimum body % for left bar', minval=0, maxval=100, step=5, tooltip = 'Minimum body to range percentage for the left formation')
_bodyPencRight = input.int(0, 'Minimum body % for right bar', minval=0, maxval=100, step=5, tooltip = 'Minimum body to range percentage for the right formation')
getRange(x, y) => math.abs(x - y)
condition_kicker_up_threshold = open[1] > close[1] and
open < close and
open > open[1] and
low > low[1] and
getRange(open[1], close[1])/getRange(high[1], low[1]) * 100> _bodyPencLeft and
getRange(open, close)/getRange(high, low) * 100> _bodyPencRight
condition_kicker_dn_threshold = open[1] < close[1] and
open > close and
open < open[1] and
high < high[1] and
getRange(open[1], close[1])/getRange(high[1], low[1]) * 100> _bodyPencLeft and
getRange(open, close)/getRange(high, low) * 100> _bodyPencRight
plotshape(condition_kicker_up_threshold?close:na, 'kicker upwards', style = shape.circle, location = location.belowbar, size = size.auto, color = color.green, display = enableKicker?display.all:display.data_window)
plotshape(condition_kicker_dn_threshold?close:na, 'kicker downwards', style = shape.circle, location = location.abovebar, size = size.auto, color = color.red, display = enableKicker?display.all:display.data_window)