TradersBASE
Register Tag Cloud Donate

Go Back   TradersBASE > TradersBASE > Analysis Methods > Indicators

Indicators Indicators, custom and common. How do you use them?


Welcome to the TradersBASE forums.

You're currently viewing the boards in guest mode which gives you limited access to our features and information. One of the big things you're missing out on is our chatbox with real time market analysis. Plus WE can't hear your thoughts on the market.

By joining our free community you'll have access to post topics, communicate with our members, and access other special features like the chatbox with that real time market insight. Being interactive with fellow traders can help all of us increase profits from the markets as well. Uncle Sam only wants your money, we want your participation. ;)

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Tags: , , , , ,


Think or Swim Indicators

Indicators


Reply
 
LinkBack (8) Thread Tools Search this Thread Display Modes
  8 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old September 28th, 2008, 11:56 AM
MC's Avatar
MC MC is offline
 
Join Date: Feb 2008
Posts: 1,574
Default Think or Swim Indicators

TTM Squeeze

declare lower;
input Length = 20;
input price = close;
######################
def e1 = (Highest(High, length) + Lowest(low, length)) / 2 + Average(close, length);
def osc = Inertia(price - e1 / 2, length);
plot oscp = osc;

def diff = reference bollingerbands(length = 20)."upperband" - reference KeltnerChannels."Upper_Band";
plot mid = 0;
mid.assignValueColor(if diff >= 0 then Color.UPTICK else Color.DOWNTICK);

#oscp.assignValueColor(if osc[1] < osc[0] then Color.CYAN else Color.magenta);
oscp.assignValueColor(if osc[1] < osc[0] then
if osc[0] >= 0 then
#UpPos
createColor(0, 255, 255) else
#UpNeg
createColor(204, 0, 204)
else if osc[0] >= 0 then
#DnPos
createColor(0, 155, 155) else
#DnNeg
createColor(255, 155, 255));

oscp.setPaintingStrategy( PaintingStrategy.HISTOGRAM);
mid.setPaintingStrategy(PaintingStrategy.POINTS);
__________________
Ask yourself..."is price attracting volume or is volume attracting price"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old September 28th, 2008, 11:59 AM
MC's Avatar
MC MC is offline
 
Join Date: Feb 2008
Posts: 1,574
Default

I didn't code this or any indicator that may become posted here! Perhaps you can find more info using the link in the helpful link section.

I did notice my TOS platform ran slower due to the heavy calculations, perhaps the code is a bit fat...I dunno.
__________________
Ask yourself..."is price attracting volume or is volume attracting price"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old April 4th, 2009, 06:09 PM
Data Manipulator
 
Join Date: Feb 2008
Posts: 252
Default

Well it took me a while but i dived into thinkscript. And luckily it is much differnt than ninja.I can usually trudge my way through. Anyway this hasnt been fully tested but it appears to work well.

If any of you listen to shadow trader he uses certain pivot points. Well i coded them for tos now.

It is adjustable for open times. I suggest setting chart to day only then adjusting time to that.

It is also adjustable to show pviots above or below. Basically when you have allot of pivots the screen gets squished and you lose perspective. Well you can adjust it so it only shows the pivots when the price is towards them. as in its only gonna show s1 pivot and s2 until price break say s1 then you will see pivot s1, and s2.

thanks
tim

here is a pic with the dynamic turned on, hence only three levels but no squished chart


here is with off so you see all the lines. note the chart kinda squished



and the code

#built by timmyb, tradersbase.com

input DynamicHide = {"No", default "Yes"};
input showOnlyToday = YES;
input Market_Open_Time = 0830;
input Market_Close_Time = 1616;


def h = DynamicHide;
def day = getDay();
def lastDay = getLastDay();
def isToday = if(day == lastDay, 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

def pastOpen = if((secondsTillTime(Market_Open_Time) > 0), 0, 1);
def pastClose = if((secondsTillTime(Market_Close_Time) > 0), 0, 1);
def marketOpen = if(pastOpen and !pastClose, 1, 0);
def firstBar = if (day[1] != day, 1, 0);

def closingBell = if secondsTillTime(Market_Close_Time)[1] > 0 and
secondsTillTime(Market_Close_Time) <= 0 or
(secondsTillTime(Market_Close_Time)[1] < secondsTillTime(Market_Close_Time)
and secondsTillTime(Market_Close_Time)[1] > 0) then 1 else 0;

rec lclose = if IsNaN(close[-1]) then lclose[1] else close;
rec regHoursHigh = if(high > regHoursHigh[1] and marketOpen, high,
if(marketOpen and !firstBar, regHoursHigh[1], high));
rec regHoursLow = if(low < regHoursLow[1] and marketOpen, low,
if(marketOpen and regHoursLow[1] > 0 and !firstBar, regHoursLow[1], low));

rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);
rec prevClose = compoundValue(1, if closingBell then runningClose else prevClose[1], close);
rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);
rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);
rec prevHigh2 = compoundValue(1, if closingBell then prevHigh[1] else prevHigh2[1], high);
rec prevLow2 = compoundValue(1, if closingBell then prevLow[1] else prevlow2[1], low);


plot pivot = if shouldPlot then (prevHigh + prevClose + prevLow) / 3 else double.nan;
pivot.SetStyle(curve.FIRM);
pivot.SetDefaultColor(color.BLACK);



plot s1 = if shouldPlot then (2 * pivot) - prevHigh else double.nan;
s1.SetStyle(curve.FIRM);
s1.SetDefaultColor(color.dark_green);

plot r1 = if shouldPlot then (2 * pivot) - prevLow else double.nan;
r1.SetStyle(curve.FIRM);
r1.SetDefaultColor(color.DaRK_RED);

plot r2 = if shouldPlot then pivot + ( r1 - s1) else double.nan;
r2.SetStyle(curve.FIRM);
r2.SetDefaultColor(color.DaRK_RED);

plot s2 = if shouldPlot then pivot - ( r1 - s1) else double.nan;
s2.SetStyle(curve.FIRM);
s2.SetDefaultColor(color.DaRK_GREEN);

plot s3 = if shouldPlot then prevLow - 2 * (prevHigh - pivot) else double.nan;
s3.SetStyle(curve.FIRM);
s3.SetDefaultColor(color.DaRK_GREEN);

plot r3 = if shouldPlot then prevHigh + 2 * (pivot - prevLow) else double.nan;
r3.SetStyle(curve.FIRM);
r3.SetDefaultColor(color.DaRK_RED);

pivot.setHiding(h and (lclose > r2 or lclose < s2));
r1.setHiding(h and lclose < s1);
r2.setHiding(h and lclose < r1);
r3.setHiding(h and lclose < r2);

s1.setHiding(h and lclose > r1);
s2.setHiding(h and lclose > s1);
s3.setHiding(h and lclose > s2);

Last edited by Timmyb : April 4th, 2009 at 08:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old April 4th, 2009, 08:41 PM
cire2222's Avatar
Overlord
 
Join Date: Feb 2008
Posts: 1,020
Default

sweet. good job tim. you the man
__________________
Visit the main blog at www.tradersbase.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old April 5th, 2009, 12:44 PM
Data Manipulator
 
Join Date: Feb 2008
Posts: 252
Default Uvol Dvol

here is another. I did not create this one but it was available for free so. I figure its ok to post here.

I am posting this one because
it has to do with shadow trader also.



displays advancing declining ratios, issues for nyse or nasdaq. can The pic shows all options. But i tend to just watch one

and the code


declare lower;

input display = {default ADIssuesRatio, ADIssues, ADVolumeRatio, ADVolume};
input market = {default NYSE, NASDAQ};

def advancing = if(market, close("$advn/q"), close("$advn"));
def declining = if(market, close("$decn/q"), close("$decn"));
def advVolume = if(market, close("$uvol/q"), close("$uvol"));
def decVolume = if(market, close("$dvol/q"), close("$dvol"));

plot Breadth;

switch(display) {
case ADIssuesRatio:
Breadth = if(advancing > declining, (advancing / declining), (-declining / advancing));
case ADIssues:
Breadth = advancing - declining;
case ADVolume:
Breadth = advVolume - decVolume;
case ADVolumeRatio:
Breadth = if( advVolume > decVolume, (advVolume / decVolume), (-decVolume / advVolume));
}

Breadth.AssignValueColor(if Breadth >= 0.0 then color.green else color.red);
Breadth.SetPaintingStrategy(paintingStrategy.HISTO GRAM);
Breadth.SetLineWeight(3);

plot ZeroLine = 0.0;
ZeroLine.SetDefaultColor(color.white);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old April 5th, 2009, 03:30 PM
Data Manipulator
 
Join Date: Feb 2008
Posts: 252
Default Manual Shadow Pivots

In a quest to make sure the pivots are perfect I also designed one that you enter the price yourself.

here is a screen shot of settings



you enter those prices and it posts the pivot points. the day setting just extends the lines. dynamic works the same as first. if on it will hide the ones price hasn't moved to.

here is code

#built by timmyb, tradersbase.com

input DynamicHide = {"No", default "Yes"};
input showOnlyToday = YES;
input Previous_High = 800.00;
input Previous_Low = 800.00;
input Previous_Settlement = 800.00;


def h = DynamicHide;
def day = getDay();
def lastDay = getLastDay();
def isToday = if(day == lastDay, 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

rec lclose = if IsNaN(close[-1]) then lclose[1] else close;

plot pivot = if shouldPlot then (Previous_High + Previous_Settlement + Previous_Low)/3 else double.nan;
pivot.SetStyle(curve.FIRM);
pivot.SetDefaultColor(color.DARK_GRAY);

plot s1 = (2 * pivot) - Previous_High ;
s1.SetStyle(curve.FIRM);
s1.SetDefaultColor(color.dark_green);

plot r1 = (2 * pivot) - Previous_Low;
r1.SetStyle(curve.FIRM);
r1.SetDefaultColor(color.DaRK_RED);

plot r2 = pivot + ( r1 - s1) ;
r2.SetStyle(curve.FIRM);
r2.SetDefaultColor(color.DaRK_RED);

plot s2 = pivot - ( r1 - s1) ;
s2.SetStyle(curve.FIRM);
s2.SetDefaultColor(color.DaRK_GREEN);

plot s3 = Previous_Low - 2 * (Previous_High - pivot);
s3.SetStyle(curve.FIRM);
s3.SetDefaultColor(color.DaRK_GREEN);

plot r3 = Previous_High + 2 * (pivot - Previous_Low) ;
r3.SetStyle(curve.FIRM);
r3.SetDefaultColor(color.DaRK_RED);

pivot.setHiding(h and (lclose > r2 or lclose < s2));
r1.setHiding(h and lclose < s1);
r2.setHiding(h and lclose < r1);
r3.setHiding(h and lclose < r2);

s1.setHiding(h and lclose > r1);
s2.setHiding(h and lclose > s1);
s3.setHiding(h and lclose > s2);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old June 14th, 2009, 11:35 PM
Registered Users
 
Join Date: Jun 2009
Posts: 5
Default

Thanks...very cool. The squeeze doesn't load on the screen for some reason and it's red in the list of active indicators. Wonder if I'm doing something wrong.

Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old June 15th, 2009, 01:10 AM
cire2222's Avatar
Overlord
 
Join Date: Feb 2008
Posts: 1,020
Default

it could be that you need to go in and delete possible spaces in the code that break it up
__________________
Visit the main blog at www.tradersbase.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old October 1st, 2009, 09:55 PM
Registered Users
 
Join Date: Oct 2009
Posts: 1
Default It's the new TOS Script Editor

The new TOS Script Editor doesn't like cut and paste from a web page. You'll need to paste into Notepad first to strip out any hidden formatting and then paste into TOS.

You can find my scripts at www.thinkscripter.com, most of which are public. I do politely ask that you leave the header intact if you republish the code here or elsewhere.
-Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old October 1st, 2009, 11:37 PM
MC's Avatar
MC MC is offline
 
Join Date: Feb 2008
Posts: 1,574
Default

Quote:
Originally Posted by ThinkScripter View Post
The new TOS Script Editor doesn't like cut and paste from a web page. You'll need to paste into Notepad first to strip out any hidden formatting and then paste into TOS.

You can find my scripts at www.thinkscripter.com, most of which are public. I do politely ask that you leave the header intact if you republish the code here or elsewhere.
-Eric
Thanks for the heads up. Feel free to post your scripts here if you want.
I get a good amount of search engine hits on thinkscript and think or swim so it may help your hit count also. I normally don't like links in signatures but feel free since you provide many free scripts.

PS I wouldn't turn down a free pro level subscription to your site if you offered.

Keep up the good work.
__________________
Ask yourself..."is price attracting volume or is volume attracting price"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



LinkBacks (?)
LinkBack to this Thread: http://www.tradersbase.com/forum/indicators/806-think-swim-indicators.html
Posted By For Type Date
swim - Threads tagged with swim: Page 4 This thread Refback November 1st, 2009 04:20 PM
Thinkscript Weblinks This thread Refback November 1st, 2009 10:46 AM
Great Places For Thinkscript This thread Refback October 25th, 2009 07:34 AM
Thinkscript Weblinks This thread Refback October 10th, 2009 02:44 AM
Great Places For Thinkscript This thread Refback September 19th, 2009 03:29 AM
swim - Members and Communities tagged with swim - Zoints This thread Refback April 17th, 2009 07:36 PM
tos - Members and Communities tagged with tos - Zoints This thread Refback April 1st, 2009 06:28 PM
squeeze - Members and Communities tagged with squeeze - Zoints This thread Refback January 28th, 2009 06:18 PM
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
NINJA TRADER INDICATORS AND STRATEGIES Timmyb Users Blogs 8 March 27th, 2009 07:52 PM
Think or Swim halp v8 muscle General Discussion "The Misc" 8 August 14th, 2008 06:34 PM
SWIM - Thinkorswim cire2222 Stocks 2 May 6th, 2008 11:36 PM
What's divergence and diverging indicators? MC Technical Analysis 1 March 29th, 2008 01:08 AM
Don't chase the holy grail of indicators MC Market University 101 2 February 10th, 2008 09:57 PM



Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC5
vBulletin Style by: kreativfantasy.com
Copyright © 2008, TradersBASE. All rights reserved.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25