Buscar

Hammer script

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

instrument {
 name = 'Hammer-Shooting',
 short_name = 'SMA-ENG',
 icon = 'https://document-export.canva.com/aEWBU/DAEnLeaEWBU/12/thumbnail/0001.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQYCGKMUHWDTJW6UD%2F20210815%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210815T043057Z&X-Amz-Expires=38724&X-Amz-Signature=3e148e0fcc80319b375e55951339a377db14d15f8291f71d83dfc9901e859fa7&X-Amz-SignedHeaders=host&response-expires=Sun%2C%2015%20Aug%202021%2015%3A16%3A21%20GMT',
 overlay = true
}
MaFast_period = input(5,"Ma Fast period",input.integer,1,1000,1)
MaFast_average = input(1,"Ma Fast average", input.string_selection,averages.titles)
MaFast_title = input(1,"Ma Fast title", input.string_selection,inputs.titles)
MaSlow_period = input(10,"Ma Slow period",input.integer,1,1000,1)
MaSlow_average = input(2,"Ma Slow average", input.string_selection,averages.titles)
MaSlow_title = input(1,"Ma Slow title", input.string_selection,inputs.titles)
MaTrend_period = input(20,"Ma Trend period",input.integer,1,1000,5)
MaTrend_average = input(2,"Ma Trend average", input.string_selection,averages.titles)
MaTrend_title = input(1,"Ma Trend title", input.string_selection,inputs.titles)
input_group {
 "Ma Fast Line",
 colorFast = input { default = "#ff56e8", type = input.color },
 widthFast = input { default = 1, type = input.line_width},
 visibleFast = input { default = true, type = input.plot_visibility }
}
input_group {
 "Ma Slow Line",
 colorSlow = input { default = "#2d2af7", type = input.color },
 widthSlow = input { default = 2, type = input.line_width},
 visibleSlow = input { default = true, type = input.plot_visibility }
}
input_group {
 "Ma Trend Line",
 colorTrend = input { default = "#f74200", type = input.color },
 widthTrend = input { default = 3, type = input.line_width},
 visibleTrend = input { default = true, type = input.plot_visibility }
}
input_group {
 "Buy Arrow",
 colorBuy = input { default = "lime", type = input.color },
 visibleBuy = input { default = true, type = input.plot_visibility }
}
input_group {
 "Sell Arrow",
 colorSell = input { default = "orangered", type = input.color },
 visibleSell = input { default = true, type = input.plot_visibility }
}
local avgFast = averages[MaFast_average]
local titleFast = inputs[MaFast_title]
local avgSlow = averages[MaSlow_average]
local titleSlow = inputs[MaSlow_title]
local avgTrend = averages[MaTrend_average]
local titleTrend = inputs[MaTrend_title]
if visibleFast == true then
 plot(avgFast(titleFast,MaFast_period),"Ma Fast",colorFast,widthFast)
end
if visibleSlow == true then
 plot(avgSlow(titleSlow,MaSlow_period),"Ma Slow",colorSlow,widthSlow)
end
if visibleTrend == true then
 plot(avgTrend(titleTrend,MaTrend_period),"Ma Trend",colorTrend,widthTrend)
end
candle_time = {"1s", "5s", "10s", "15s", "30s", "1m", "2m", "5m", "10m", "15m", "30m", "1H", "2H", "4H", "8H", "12H", "1D", "1W", "1M", "1Y"}
candle_time_res = input(6,"Candle check resolution",input.string_selection,candle_time)
sec = security (current_ticker_id, candle_time[candle_time_res])
if (sec ~= nil) and (sec.open_time == open_time) then
 
 Mafast0 = avgFast(titleFast,MaFast_period) --Ma Fast bar 0
 Mafast1 = Mafast0[1] --Ma Fast bar 1
 
 MaSlow0 = avgSlow(titleSlow,MaSlow_period) --Ma Slow bar 0
 MaSlow1 = MaSlow0[1] --Ma Slow bar 1
 
 MaTrend0 = avgTrend(titleTrend,MaTrend_period) --Ma Trend 0
 Matrend1 = MaTrend0[1] --Ma Trend 1
 
 plot_shape(open < close and min(close,open)-low > abs(close-open)*2 and high-max(open,close) < abs(close-open)*0.5 and close > Mafast0 and Mafast0 > MaSlow0 and MaSlow0 > MaTrend0,
 "Call",
 shape_style.arrowup,
 shape_size.huge,
 colorBuy,
 shape_location.belowbar,
 0,
 "Hammer",
 colorBuy 
 ) 
 
 plot_shape(open > close and min(close,open)-low < abs(close-open)*0.5 and high-max(open,close) > abs(close-open)*2 and close < Mafast0 and Mafast0 < MaSlow0 and MaSlow0 < MaTrend0 ,
 "Put",
 shape_style.arrowdown,
 shape_size.huge,
 colorSell,
 shape_location.abovebar,
 0,
 "Shooting",
 colorSell
 )
 
end

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando