This script allows you to import TA and price levels from an external source. For example, you may do some TA on a different software but want to import it to TradingView. Or you may have a script or bot that calculates levels for you end-of-day. Or you may be part of a community that provides TA and levels. There are many different reasons why you may want to import levels from an external source.
All you need is a source for the data. The data format shouldn't really matter since it can usually be converted fairly easily to a custom format. Information about the necessary format can be found below.
The script currently supports:
Labelled lines with customs style and colors
Boxes / zones with custom fill color and borders
Fibonacci ratios
In the plans:
Channel support
Trend lines
The input format looks like this:
FIGURE 1 - Lines with labels Columns: <start timestamp>,<price>,<label text>,<RGBA line color*>,<line style*>; Example: 1677724019999,3976.50,Label text,255/255/0/125,sol
FIGURE 2 - Boxes Columns: <left timestamp>,<top price>,<right timestamp>,<bottom price>,<RGBA fill color*>,<filled or not (1 | 0)>,<border width>,<RGBA border color*>; Example: 1686715971428,4430.18,1686773561538,4409.52,68/98/194/15,1,1,153/204/255/204
FIGURE 3 - Fibonacci ratios Columns: <start timestamp>,<start price>,<end timestamp>,<end price>,<line style*>,<extend right (1 | 0)>,<line width>,<ratios*>,<ratio colors*> Example: 1656649151300,4588.75,1656649151300,3639,dot,1,3,0.236|0.382|0.5|0.618|0.706|0.786|0.886,170/200/255/76|170/200/255/76|170/200/255/76|0/255/0/76|255/153/0/76|255/153/0/76|255/153/0/76 *ratios and ratio colors are separated by '|'
*RGBA colors must look like this: 255/255/0/125, each value separated by '/' *Line styles must be one of these values: dsh, sol or dot (dashed, solid or dotted)
Separate each item within the same figure with a semicolon (;), e.g for two labelled lines: 1677724019999,3976.50,Label text,255/255/0/125,sol;1677724019999,4026,Label text 2,255/255/0/125,sol Only put a semicolon at the end if there is a new item after it.
Finally, put all figures together with '§' separator between each figure/category, in the correct order: 1 - Lines with labels 2 - Boxes 3 - Fibonacci ratios
The result looks like this for the examples above: 1677724019999,3976.50,Label text,255/255/0/125,sol§1686715971428,4430.18,1686773561538,4409.52,68/98/194/15,1,1,153/204/255/204§1656649151300,4588.75,1656649151300,3639,dot,1,3,0.236|0.382|0.5|0.618|0.706|0.786|0.886,170/200/255/76|170/200/255/76|170/200/255/76|0/255/0/76|255/153/0/76|255/153/0/76|255/153/0/76
An incorrect format will give you errors.
With basic programming skills you can create a simple tool to convert your data to this format, that's what I do. If needed, I may be able to provide a customized converting tool for this, PM if interested.
Nota Keluaran
Fixed an issue with duplicated lines and labels.
Nota Keluaran
Allow empty values for a specific figure by placing a dash (-) in between the figure sparator (§).
Nota Keluaran
Added FIGURE 4 - Channels. See format below.
Added alert support for lines and channels
It's now possible to add levels for up to 3 different symbols per indicator, instead of just 1.
Added an optional "end timestamp" for lines. Same format as before but add a timestamp to the end (or skip it to default to an extended line):
CHANNEL data format: <start candle time string>,<end candle time string>,<top start price>,<top end price>,<bottom start price>,<bottom end price>,<extend right (1 | 0)>,<show mid line (1 | 0)>,<RGBA line color>,<timeframe* | '-' for any>
Channel example: 2024-04-04-16-00,2024-04-10-12-00,5308.5,5267.75,5194.35,5153.6,1,1,255/255/255/255,- Note: for now the timestamp format is different for channels because of a pine script limitation with alerts.
Skrip ini diterbitkan secara sumber tertutup dan anda boleh menggunakannya dengan bebas. Anda boleh menyukainya untuk menggunakannya pada carta. Anda tidak dapat melihat atau mengubah kod sumbernya.
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.