RE: US Stocks - Watchlist and Discussion
(2015-07-23, 06:07 AM)CH868 Wrote: gbarbs,
How did you create the mansfielddaily and weekly indicators on thinkorswim platform ?
Not sure how familiar you are so let me know if you need more details...but you first click on the edit and studies button in the top right area.
In the bottom left of the pop up window, underneath all of the studies click on "new"
You can name the study in the very top that's where I put "Mansfield Daily". Then paste in the following code into thinkscript editor for the daily mansfield:
declare lower;
input CorrelationWithSecurity = "SPX";
def SPXclose = close(CorrelationWithSecurity);
def R200 = close/SPXclose;
def RS_today = close / SPXclose;
def BSAverage = (sum(r200, 200)/200);
Plot RS2 = ((R200/BSAverage)-1)*10;
plot zeroline = 0;
RS2.SetDefaultColor(GetColor(6));plot Data = close;
for the weekly, use the following:
declare lower;
input CorrelationWithSecurity = "SPX";
def SPXclose = close(CorrelationWithSecurity);
def R52 = close/SPXclose;
def RS_today = close / SPXclose;
def BSAverage = (sum(r52, 52)/52);
Plot RS2 = ((R52/BSAverage)-1)*10;
plot zeroline = 0;
RS2.SetDefaultColor(GetColor(6));plot Data = close;
Once you do this they will show up in your list of studies on the left hand side and you can add them to the chart. Once you do go into the settings of the study and click on the tab that says "data". You want to uncheck the box so it does not plot data. RS2 and zeroline should have the plot box checked.
Hope this helps see screen shots if this doesn't make sense