TradingView
chipmonk
9 יולי 2023 10:52

Cloud Levels [Import Price Levels] 

E-mini S&P 500 FuturesCME

תיאור

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.

הערות שחרור

Fixed an issue with duplicated lines and labels.

הערות שחרור

Allow empty values for a specific figure by placing a dash (-) in between the figure sparator (§).

הערות שחרור


  • 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):

1712619257142,5214.12,Line 1,207/165/71/255,sol,1712887200000


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.

* Timeframe should be same format as returned by timeframe.period in pinescript ("60" for 60 minutes, "D" for one day, "2W" for two weeks, "3M" for one quarter.)
https://www.tradingview.com/pine-script-reference/v5/#var_timeframe.period

Check comments for a full up-to-date example (I can't edit example in previous release notes).

תגובות
chipmonk
All figures example:

1712638079999,5212,Line,144/238/144/255,sol,1712887200000;1712745360000,5104.5,Extended line,135/206/235/255,sol§1712571119999,5143.57,1712888639998,5126.26,68/98/194/15,1,1,153/204/255/204 §1712246400000,5308.5,1712260800000,5192.5,dsh,1,1,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|189/191/9/204|189/191/9/204|255/1/251/204|255/1/251/204§2024-04-04-16-00,2024-04-10-12-00,5308.5,5267.75,5194.35,5153.6,1,1,255/255/255/255,-

Only lines example:

1712638079999,5212,Line,144/238/144/255,sol,1712887200000;1712745360000,5104.5,Extended line,135/206/235/255,sol§-§-§-

Why no edit button in release notes, TradingView?? Anyway, here's the 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>

* Timeframe should be same format as returned by timeframe.period in pinescript ("60" for 60 minutes, "D" for one day, "2W" for two weeks, "3M" for one quarter.)
tradingview.com/pine-script-reference/v5/
עוד