Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views1 page

Grid Line V2

The document describes a script for plotting grid lines on a financial chart based on the current ticker ID. It sets different rounding and calculation parameters for various currencies, particularly focusing on JPY and XAUUSD. The script generates price levels around a pivot point and visualizes them with distinct colors and widths depending on their position relative to the pivot.

Uploaded by

khelil salem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Grid Line V2

The document describes a script for plotting grid lines on a financial chart based on the current ticker ID. It sets different rounding and calculation parameters for various currencies, particularly focusing on JPY and XAUUSD. The script generates price levels around a pivot point and visualizes them with distinct colors and widths depending on their position relative to the pivot.

Uploaded by

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

instrument {

name = 'Grid Line V2',


icon = 'https://www.vdk.be/sites/default/files/styles/teaser_image_xs/public/
2019-09/icon-profit.png?itok=0RrQq3c7',
overlay = true
}
setFix = input(5, "Set Point", input.double, 0.000001)
sec = security (current_ticker_id, "1H")

--print(current_ticker_id) -- 84 79 85 6 3 4 101 106 949 1024 // XAUUSD 74

local getID = {84, 79, 85, 6, 3, 4, 101, 106, 949, 1024}


local len_getID = #getID

--print(len_getID)

if current_ticker_id == 74 then
roundSet = 1
calSetfix = 0.01
else --JPY
for i = 1, len_getID, 1 do
if current_ticker_id == getID[i] then
roundSet = 10
calSetfix = 0.001
break
else
roundSet = 1000
calSetfix = 0.00001
end

end
end

if sec then
getPrice = sec.open[0]
intPrice = round(roundSet * getPrice )
pricePivot = intPrice /roundSet

for i = -15, 15, 1 do


priceLevel = pricePivot + (i * setFix * calSetfix)

if i == 0 then
color = "white"
wd = 3

elseif i < 0 then


color = "red"
wd = 1
elseif i > 0 then
color = "#00FF2A"
wd = 1
end

plot(priceLevel, i, color,wd, 0, style.levels)

end

end

You might also like