[go: up one dir, main page]

50% found this document useful (4 votes)
3K views2 pages

Trading Bot Signal Script

The document defines the inputs and calculations for a moving average crossover trading strategy. It takes in user-defined fast and slow moving average periods, a signal period, and color options. It calculates a fast and slow moving average of the selected value, takes the difference, applies a weighted moving average, and generates buy and sell signals when the fast crosses the slow moving average from below and above, respectively. The signals are plotted as up and down triangles on the chart.

Uploaded by

Junaid Abdul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (4 votes)
3K views2 pages

Trading Bot Signal Script

The document defines the inputs and calculations for a moving average crossover trading strategy. It takes in user-defined fast and slow moving average periods, a signal period, and color options. It calculates a fast and slow moving average of the selected value, takes the difference, applies a weighted moving average, and generates buy and sell signals when the fast crosses the slow moving average from below and above, respectively. The signals are plotted as up and down triangles on the chart.

Uploaded by

Junaid Abdul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

instrument { name = "CHAT GPT ", icon="", overlay = true }

method_id = input (1, "Type", input.string_selection,


{ "ProBinaryBot" })
instrument {
name = 'CHAT GPT',
short_name = 'super',
icon = 'indicators:BB',
overlay = true
}
MaFast_period = input(1,"Ma Fast period",input.integer,1,1000,1)
MaValue = input(5,"Ma Value", input.string_selection,inputs.titles)
MaSlow_period = input(34,"Ma Slow period",input.integer,1,1000,1)
Signal_period = input(5,"Signal period",input.integer,1,1000,1)
input_group {
"Compra",
colorBuy = input { default = "green", type = input.color },
visibleBuy = input { default = true, type = input.plot_visibility }
}
input_group {
"Venda",
colorSell = input { default = "red", type = input.color },
visibleSell = input { default = true, type =
input.plot_visibility }
}
local titleValue = inputs[MaValue]
-- mdia mvel linear rpida
smaFast = sma(titleValue, MaFast_period)
-- mdia mvel linear devagar
smaSlow = sma(titleValue, MaSlow_period)
-- calculo diferencial - serie
buffer1 = smaFast - smaSlow
-- clculo da mdia mvel ponderada - serie
buffer2 = wma(buffer1, Signal_period)
buyCondition = conditional(buffer1 > buffer2 and buffer1[1] <
buffer2[1] and not (buffer1 < buffer2 and buffer1[1] > buffer2[1]))
buyCondition = conditional(buffer1 > buffer2 and buffer1[1] <
buffer2[1])
sellCondition = conditional(buffer1 < buffer2 and buffer1[1] >
buffer2[1] and not (buffer1 > buffer2 and buffer1[1] < buffer2[1]))
sellCondition = conditional(buffer1 < buffer2 and buffer1[1] >
buffer2[1] )
plot_shape(
(buyCondition),
"B",
shape_style.triangleup,
shape_size.huge,
colorBuy,
shape_location.belowbar,
-1,
"B",
"white"
)
plot_shape(
(sellCondition),
"S",
shape_style.triangledown,
shape_size.huge,
colorSell,
shape_location.abovebar,
-1,
"S",
"white"
)

You might also like