I track my portfolio in Excel with the RTD Function, however, ETFs do not seem to be recognized by the function. Any suggestions? I apologize if this question is outside the scope of this forum. I searched and found references to Excel but the search feature sent me to google for ETFs which I had already tried. I'd rather not fiddle with TOS's API if avoidable.
@XeoNoX No response at all from TOS Support. However, the issue self-corrected. I think it was a matter of closing both apps and reopening in sequence (TOS then Excel), which is something I should have realized. Thanks again for your response.
I am new to Think or Swim and this forum. I would like to perform statistical analysis on exported Market-Watch list data with Excel.
I export my Market-Watch list to Excel for analysis and get updated dynamic values of various boiler plate default parameters. My charts are set to display candlesticks. The Open, High and Low columns in my watch list are static and only change if a value is positively or negatively exceeded.
Is there an Excel RTD command code that will capture the OPEN, HIGH, LOW and CLOSE values of each candle that is plotted dynamically in the chart?
I generally use a chart time interval of 1 Day 1 minute. I use style box float data to see a variety of parameters that include the OPEN, HIGH, LOW and Close for a particular candle, displayed as I hover over a candle with my mouse. I would like to export each candle stick data group (OHLC) into Excel dynamically, as I do the other parameters in my Market Watch list.
I think it depends on the timeframe you wish to execute your analysis in. If you want to do your analysis somme time after the day, I have seen a way to trick ToS into giving you candle by candle reports by executing a strategy that opens and closes a position every candle and copy/paste the strategy results into your spreadsheet.
If you don't like that route, and you feel technically savvy, you can choose to get an Ameritrade Developer Account (it's free) which will allow you to use their API (and python or Java though why anyone would use Java I don't understand) to pull data either live or historical direcly into a program (a small python script could be written to download and export a csv of your data easily enough.
I think it depends on the timeframe you wish to execute your analysis in. If you want to do your analysis somme time after the day, I have seen a way to trick ToS into giving you candle by candle reports by executing a strategy that opens and closes a position every candle and copy/paste the strategy results into your spreadsheet.
If you don't like that route, and you feel technically savvy, you can choose to get an Ameritrade Developer Account (it's free) which will allow you to use their API (and python or Java though why anyone would use Java I don't understand) to pull data either live or historical direcly into a program (a small python script could be written to download and export a csv of your data easily enough.
Mashume - Thank you for your quick response and suggested approaches. I would like to obtain the dynamic OHLC candle data in real time during the trading day. The Market Watch screen would be the logical place to insert that data since the table is updating in real time and the columns for O, H andL already exist. The issue I believe is that TDA does not wish to provide the data for what ever reason unknown to me. I like the TDA venue and is very helpful for simple trades and analysis. Trading options is another story requiring as much data as possible to make useful analysis of positions and to determine entry and exit points. I understand that candles also provide a good sense of market psychology and would be a valuable asset to have that data exported to Excel in real time as is all of the other data as well. Seems to me that adding the OHLC data would involve a simple coding modification since the data is available as expressed in a candle chart. I may need to find another platform to realize my goal. Thanks again.
it's been awhile since i have experimented with exporting data, so i'm a little rusty. i think you can configure excel to pull data on some interval.
you could collect data every x seconds. then use excel to combine the data into the desired timeframe.
the default way RTD works is, it keeps pulling new data, and overwriting previous data.
at the end of this post, is a macro that copies new data to a new cell,
here are some links/info related to RTD
how to export tos data to excel
this will create a collection of formulas in excel, that will pull live data
it will not save it. Each new data overwrites the previous data
TOS
marketwatch > quotes
setup page with symbols and data columns
settings( top right) > export > to microsoft excel
go to an excel sheet, pick a cell , and paste
creates a bunch of rtd( ) formulas, to pull all the data, as it was laid out on marketwatch page.
=RTD( " tos.rtd", , "last", "SPY" )
get last price for stock symbol in cell c1
=RTD( " tos.rtd", , "last", C1 )
i think the Excel formula RTD() will only work on a computer that has TOS installed
use a macro to copy data to a new cell, to save it
recording spx using tos and rtd function
mhaddadi
[media]
[/media]
each second, this macro copies the price data, from D1, down to a lower cell, in column B.
Cells(m, 2) = Cells(1, 4)
Cells(row, column)
the code would have to be changed to copy more data.
Code:
' vba code
' module1
Sub timer()
' run a macro every sec
Application.OnTime Now() + TimeValue("00:00:01"), "main"
End Sub
Sub main()
' row counter
m = m + 1
' put time in row m at column 1
Cells(m, 1) = Now
' pull stock data value from D1, put in row m at column 2
Cells(m, 2) = Cells(1, 4)
' call other macro
timer
End Sub
Is there a way via thinkscript (or anything) to write data to a CSV file? i.e. if AddOrder is triggered can that be written to a CSV file with all the other data on the chart?
I know you can do a strategy report but that doesn't show other technical indicators or things like previous close, next open, etc. What I want to do is dump all data on the chart for the day the strategy got triggered, the day before and the day after. For analyzing backtesting this would be helpful.
i think you will want to setup the
marketwatch tab with columns of the data you want. then export it to excel, to create the RTD formulas. by default, new data overwrites old data. at the bottom of the 2nd link is a macro to copy data to a new sheet.
I have a spreadsheet of stocks I am holding and it automatically updates current price. I want to add a column at the end which will calculate the daily close 5 EMA to make sure the closing price stays above the 5 EMA on all my holdings. I don't see anything simple in the Stocks data filters which could do this. Any ideas without getting complicated with tables and VBAs?
I think you are answering the question as though I would want this in TOS. I am keeping portfolios in Excel 365. So this is my question.
Completely seperate from TOS
I think you are answering the question as though I would want this in TOS. I am keeping portfolios in Excel 365. So this is my question.
Completely seperate from TOS
I think you are answering the question as though I would want this in TOS. I am keeping portfolios in Excel 365. So this is my question.
Completely seperate from TOS
you say the prices auto update. i think #4 poster was thinking you could add a column in tos that calculates the ema. then export it to excel, then copy that formula to your sheet, so it would pull in the desired ema.
I have a spreadsheet of stocks I am holding and it automatically updates current price. I want to add a column at the end which will calculate the daily close 5 EMA to make sure the closing price stays above the 5 EMA on all my holdings. I don't see anything simple in the Stocks data filters which could do this. Any ideas without getting complicated with tables and VBAs?
I have been utilizing the RTD (Real Time Data) function to import data into Excel.
No issues then using the values until I started with financials (10-yr T-Notes, 30 Yr Bonds, etc.) I do not have any issues importing the values into excel.
Here is an example of the function I would be using in Excel =RTD("tos.rtd",,"LAST", "/ZN:XCBT"). The function works and it pulls in the "Last" price for the 10-Yr T-Note. However, where I am struggling is the number format it's providing. For example, 122'075. Within Excel it behaves like text but NONE of the Excel functions to convert text to number or values works. I am always left with the following: #VALUE!. I realize this is as much an Excel related question as it is TOS. But has anybody experienced this previously and did you discover an approach to convert values from the following format 122'075 to 122.075?
Important Note: I can pull other data that is related to CBOT, Wheat, Corn, etc. and the formats are fine. This is only related to Financials.
I have been utilizing the RTD (Real Time Data) function to import data into Excel.
No issues then using the values until I started with financials (10-yr T-Notes, 30 Yr Bonds, etc.) I do not have any issues importing the values into excel.
Here is an example of the function I would be using in Excel =RTD("tos.rtd",,"LAST", "/ZN:XCBT"). The function works and it pulls in the "Last" price for the 10-Yr T-Note. However, where I am struggling is the number format it's providing. For example, 122'075. Within Excel it behaves like text but NONE of the Excel functions to convert text to number or values works. I am always left with the following: #VALUE!. I realize this is as much an Excel related question as it is TOS. But has anybody experienced this previously and did you discover an approach to convert values from the following format 122'075 to 122.075?
Important Note: I can pull other data that is related to CBOT, Wheat, Corn, etc. and the formats are fine. This is only related to Financials.
paste this into a1
below the slashes
////////////////////////////////
Code:
=RTD("tos.rtd",,"LAST", "/ZN:XCBT")
=RTD("tos.rtd",,"LAST", "/ZN:XCBT") price as text, RTD( )
=LEN(A2) length data text
=SEARCH("'",A2,1) decimal location
=A3-A4 right char len
=LEFT(A2,A4-1) left digits
=MID(A2,A4+1,A5) right digits
. decimal point
=VALUE(A7&A9&A8) price converted to number
1 some number
=A11*A12 number x price
then press control ~ again , to see values , not formulas
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
How do I get started?
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.