Achiles @rzimtrader
Achiles @rzimtrader
-- Input groups
input_group {
"Buy Settings",
buy_color = input {default = "green", type = input.color}
}
input_group {
"Time Periods",
max_min_period = input {default = "10", type = input.string}
}
input_group {
"Micro Trend Period",
micro_trend_period = input {default = "10", type = input.string}
}
input_group {
"Macro Trend Period",
macro_trend_period = input {default = "100", type = input.string}
}
input_group {
"Fast EMA",
fast_ema_period = input {default = "3", type = input.string}
}
input_group {
"Slow EMA",
slow_ema_period = input {default = "13", type = input.string}
}
input_group {
"Sell Settings",
sell_color = input {default = "#fcf805", type = input.color}
}
input_group {
"Candle Colors",
bullish_color = input {default = "", type = input.color},
neutral_color = input {default = "", type = input.color},
bearish_color = input {default = "", type = input.color}
}
-- Calculations
ema_micro = ema(close, micro_trend_period)
ema_macro = ema(close, macro_trend_period)
fast_ema = ema(hlc3, fast_ema_period)
slow_ema = ema(hlc3, slow_ema_period)
high_period = highest(high, max_min_period)
low_period = lowest(low, max_min_period)
-- Trend analysis
bullish_trend = (close > close[1]) and (close > ema_micro) and (ema_micro >
ema_micro[1])
bearish_trend = (close < close[1]) and (close < ema_micro) and (ema_micro <
ema_micro[1])
bullish_cross = (fast_ema[1] < slow_ema[1]) and (fast_ema > slow_ema)
bearish_cross = (fast_ema[1] > slow_ema[1]) and (fast_ema < slow_ema)
if bullish_trend then
candle_color = bullish_color
elseif bearish_trend then
candle_color = bearish_color
else
candle_color = neutral_color
end
if ((close[1] < open[1]) and (close > open) and (close > high[1]) and close[2] >=
open) then
plot_shape(1, 'Bull_Engulfing', shape_style.labelup, shape_size.huge,
call_color, shape_location.belowbar, 0, "Analisando", "White")
elseif ((close[1] > open[1]) and (close < open) and (close < low[1]) and close[2]
<= open) then
plot_shape(1, 'Bear_Engulfing', shape_style.labeldown, shape_size.huge,
put_color, shape_location.abovebar, 0, "Analisando", "White")
end
-- Achiles @rzimtrader
instrument { name = "Achiles @rzimtrader", icon = "https://i.ibb.co/DKzFQwN/logo-
pra-script.png", overlay = true }
percentage = input(2, "Reversal Percentage", input.double, 0.01, 100, 1.0) / 100
zigzag_period = 3
input_group {
"Achiles Colors",
up_color = input { default = "", type = input.color },
down_color = input { default = "", type = input.color },
line_width = input { default = 6, type = input.line }
}
if get_value(trend_up) then
high_track:set(max(high, nz(high_track[1], high)))
if close < high_track[1] - reversal_range then
pivot_point:set(high_track)
trend_up:set(false)
reference:set(high_track)
end
else
low_track:set(min(low, nz(low_track[1], low)))
if close > low_track[1] + reversal_range then
pivot_point:set(low_track)
trend_up:set(true)
reference:set(low_track)
end
end