| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #17 | ||
![]() | Re: Think or Swim Code/indicators 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 BollingerBandsSMA(length = 20)."upperband" - reference KeltnerChannels."Upper_Ba nd"; 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.HISTOGRA M); mid.setPaintingStrategy(P aintingStrategy.POINTS); | ||
| |
|
| | #18 | ||
![]() | Re: Think or Swim Code/indicators def diff = reference BollingerBandsSMA(length = 20)."upperband" - reference KeltnerChannels."Upper_Ba nd"; oscp.setPaintingStrategy( PaintingStrategy.HISTOGRA M); mid.setPaintingStrategy(P aintingStrategy.POINTS); If you strip out these spaces, the indicator should verify... | ||
| |
|
| | #19 | ||
![]() | Re: Think or Swim Code/indicators suggestion--- the thinkscript manual is really scarce on examples-- it kind of assumes someone is familiar with coding generally. it would really be helpful if someone could explain SIMPLE functions in a concrete way, like building blocks to create a desired result. EXAMPLE: i'm struggling to write this simple code (and i'd appreciate any help- i keep getting errors)--- ======================== 1. to display two stocks upper (any format, candles or whatever, avg price or whatever) 2. single plot in lower study that shows the difference between the two stocks, but using the avg of daily hi+lo+close.========================= ====== see what i mean? if someone had a building block that showed them how to plot multiple stocks (upper), and another building block that showed them how to plot interactions (+,-, /,sqrt etc) of those stock values (lower), they could build many indicators. anyway, just a suggestion and request from a frustrated newbie coder-- Dennis | ||
| |
|
| | #20 | ||
![]() | Re: Think or Swim Code/indicators First, I'm not a TOS coding expert, but I have played around a little. A good way to learn the language seems to be by looking at the predefined indicators that have source code. These are the ones with the little scroll or paper icon next to them (double click on it). To your specific items, I played around a little and came up with these simple examples that you can expanded on (please share!): 1) display two stocks in upper: # Simple example of plotting two stock in upper # Data1 will be the primary stock you are viewing plot Data1 = close; # Data2 will be the comparison stock plot Data2 = close("c"); 2) display the difference between two stocks in lower: declare lower; def Data1 = close; def Data2 = close("c"); plot Diff = Data1 - Data2; There is also several "comparison" studies that compare your current stock to various others. It looks like you can change the line style and stock to compare to as well. Hope that helps, John | ||
| |
|
| The Following User Says Thank You to trader_john For This Useful Post: | ||
orangequant (12-01-2008) | ||
| | #21 | ||
![]() | Re: Think or Swim Code/indicators Quote:
EDIT~~~ that was exactly what i meant by "building blocks" to help a newbie understand-- from your example i can see how to build some other stuff too Bump: im still working on code you provided, John, which has much more potential than this from their manual--- somehow between the two i should be able to finally get exactly what i want--- +++++++++++++++++++++++++ + declare lower; plot data = close-close("enter symbol"); +++++++++++++++++++++++++ + Bump: im still working on code you provided, John, which has much more potential than this from their manual--- somehow between the two i should be able to finally get exactly what i want--- +++++++++++++++++++++++++ + declare lower; plot data = close-close("enter symbol"); +++++++++++++++++++++++++ + Bump: im still working on code you provided, John, which has much more potential than this from their manual--- somehow between the two i should be able to finally get exactly what i want--- +++++++++++++++++++++++++ + declare lower; plot data = close-close("enter symbol"); +++++++++++++++++++++++++ + | ||
| |
|
| | #22 | ||
![]() Join Date: Jan 2008 Location: africa Posts: 988 Thanks: 46
Thanked 41 Times in 33 Posts
Blog Entries: 6 | Re: Think or Swim Code/indicators ...or this indicator ? SHME PushHiLo AutoX ...thanks Last edited by elovemer; 12-06-2008 at 04:35 AM. | ||
| |
|
| | #23 | ||
![]() | Re: Think or Swim Code/indicators | ||
| |
|
| | #24 | ||
![]() Join Date: Jan 2008 Location: africa Posts: 988 Thanks: 46
Thanked 41 Times in 33 Posts
Blog Entries: 6 | Re: Think or Swim Code/indicators ....works very well..... as does TSI ....is that what you want ? ttm squeeze ? ..... anybody have a ERGODIC indicator for tos ? .....anybody have any idea what settings to use with SMI indicator ? Quote:
| ||
| |
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| TTM Indicators for CQG? | bathrobe | Coding Forum | 3 | 01-03-2011 07:01 AM |
| TradeStation Strategy Code Help | jjthetrader | Coding Forum | 2 | 10-26-2010 09:06 AM |
| TTM trend esignal code | philloo | Trading Indicators | 9 | 04-16-2009 10:51 AM |
| Does Anyone have the TTM Scalper Code for Esignal??? | jphillips9 | Beginners Forum | 5 | 01-14-2008 08:26 PM |
| Floor Trader Pivot Code Help.... | jmi88 | Coding Forum | 1 | 05-22-2007 11:13 PM |