Is it possible to copy and paste data into a think script?


Category:
0
0

I have a web page that provides daily trading levels for various markets.  I was wondering if it is possible to grab html data and create a method to easily copy the data into a tos script so I can then update those levels on my charts?

Any thoughs/ideas would be appreciated.

Thanks

Mike

Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on August 27, 2019 8:31 am
272 views
0
Private answer

Without a copy of your spreadsheet I can't do much for you. If you have a column of values and you want to convert those to basic plot statements, you can create a formula in the next column to concatenate the values from the first column into plot statements.

concatenate | kənˈkatnˌāt |
verb [with object] formal or technical
link (things) together in a chain or series: some words may be concatenated, such that certain sounds are omitted.

So let's say you have a value of 1200 in column A. In column B you would create a formula like this:

= "plot a1 = " & A1 & ";"

This will create a text value in column B that you can copy/paste into a new chart study in Thinkorswim. The plot statement for the example above would look like this:

plot a1 = 1200;

You can add another column to contain the plot name and include that in your formula. I have attached a sample spreadsheet, generated via Google Sheets and exported as a .xlsx compatible file.

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on August 27, 2019 9:55 am
0
Thank you! That gives me a start. What would I add to the script/spreadsheet so the lines are particular to a symbol? So for example let's say I have a price level for /cl and one for /nq. So I only want the level for that symbol show when I am on that symbol if that makes sense? Thanks for the quick response!
( at August 27, 2019 10:25 am)
0

Let's see if you can implement this.

plot valueForCL = if !IsNaN(close(symbol = "/CL")) then 57 else Double.NaN;

That is the basic structure. Now see if you can implement this in your spreadsheet.

( at August 27, 2019 3:04 pm)