Hi Trader, You are certainly welcome Good Luck and Good Trading!by netarchitech - Trading Discussion
Hi Trader, Is this what you're looking for? input price = close; input length = 20; input displace = 0; plot HMA = MovingAverage(AverageType.HULL, price, length)[-displace]; AddCloud(price, HMA, Color.GREEN, Color.RED); Hope this helps...by netarchitech - Trading Discussion
Hi Trader, TOS is down for maintenance, so I'll tinker with the Hull and Clouds this weekend when the system comes back on line...by netarchitech - Trading Discussion
Hi Trader, Actually, I believe that code should colorize the moving average itself, not the chart background. Try something like this... input price = close; input length = 20; input displace = 0; plot HMA = MovingAverage(AverageType.HULL, price, length)[-displace]; AssignBackgroundColor(if price > HMA then Color.GREEN else Color.RED); Hope this helps... One more thing...yby netarchitech - Trading Discussion
You are certainly welcome Is there a particular ticker you're working with? It should work, but this wouldn't be the first time TOS threw a curveball...by netarchitech - Trading Discussion
How 'bout this: declare upper; def isAbove = ExpAverage(close, 8) crosses above ExpAverage(close, 20); def isBelow = ExpAverage(close, 8) crosses below ExpAverage(close, 20); AssignBackgroundColor(if isAbove then CreateColor(153, 255, 153) else if isBelow then CreateColor(255, 102, 255) else (color.current)); Also, unless you want to draw on a chart, use def instead of plot, which wby netarchitech - Trading Discussion
For those whom might be interested, here's the solution to the bracket issue: high(period="day" )[1]; #(array reference after the function) Thanks to Derek for his assistance...by netarchitech - Trading Discussion
OK...I figured out the error..."noob" that I am, I was confusing a variable with a function...as a result I've gone back and totally rewritten the code to properly address the situation... As a result of the rewrite, I now face another issue, namely brackets cannot be used with a function to reference a prior period... So while I'm still wondering why the compiler flagged only ceby netarchitech - Trading Discussion
Given the following: I'm left wondering why "No such function" and why has the compiler flagged only certain instances? Any thoughts? Thanks in advance...by netarchitech - Trading Discussion
QuoteRobert Just set your doji equal to a range, say the close is within 1% of the open. plot HAdoji = HAclose >= 0.99 * HAopen AND HAclose <= 1.01 * HAopen; That did it! Thanks a million, Robert. Much appreciatedby netarchitech - Trading Discussion
QuoteRobert That just means that there aren't any HA dojis at this time. Thanks for the confirmation. I guess I was thinking, although dojis are not necessarily a frequent occurrence, there would be possibly be at least one returned, given a scan for all stocks on all timeframes... With that said, would you know a way to scan for HA candles where it is not quite an exact doji? Is there possby netarchitech - Trading Discussion
Tried this: def haclose = (open + high + low + close) / 4; def haopen = compoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close[1]) / 2); plot hadoji = haclose is equal to haopen; Passes syntax test, yet "no matching symbols" on various timeframes... Also tried creating a custom study, HADoji(), using thinkscript above, then entering HADoji() is true in Stock Hacker...by netarchitech - Trading Discussion
Given: haclose = (open + high + low + close) / 4; haopen = compoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close[1]) / 2); Is it possible to find results for haclose = haopen using a Stock Hacker scan? Thanks in advance...by netarchitech - Trading Discussion
Tanman, Please accept my apologies for the delay with this reply. Life seems to get in the way of the plans I would prefer to make. Thank you for the kind words. Warning...don't be too nice to me or you'll have a hard time trying to get rid of me...hahaha As for sharing and exchanging information, I prefer to think the gift is in the giving...and for that, thank you for all you so generouslyby netarchitech - Trading Discussion
Yeah...I'm a stranger in a strange land, pushin' the envelope a little bit, blowin' off some steam... My prescription...for what's it's worth...take two aspirin and stop throwin' military hardware around in the morning "Tanks" again...by netarchitech - Trading Discussion
Before I delve into the second installment of my reply, I want to thank Richie Rick for injecting a little levity into the ongoing discussion. Humor is *always* welcome in my book, so long as I am not the butt of the joke...just kidding...hahaha Picking up where I left off, Tanman, I believe I was responding to your insights with regard to Volume, Supply and Demand. I found the following in mby netarchitech - Trading Discussion
Tanman, I thank you for being so gracious with your reply. Your response was, without a doubt, the best correspondence I have ever received in a forum. The honor is truly all mine… As for learning, I look forward to establishing an exchange of ideas and sharing of solutions. I have already gained significantly greater insights as a result of reading your latest response here, as well as tby netarchitech - Trading Discussion
Tanman, First of all, I am returning to the "Fun with Thinkscript" thread after a somewhat protracted hiatus and I am very happy to see it thriving. When the OP, Robert, informed the community that he would be leaving for an indeterminate hiatus himself, it seemed, at the time, that the thread might be coming to an end. It is very good to know that is not the case... As I have speby netarchitech - Trading Discussion
Robert, Good luck and all the best with your advanced programming class. Since I haven't been around these parts in a while, I've been catching up and read that you recently moved. I certainly hope it all went smoothly... I look forward to hopefully seeing you back around here in a month or soby netarchitech - Trading Discussion
I've been trying to work with the following scan code. Unfortunately, there appears to be a 3 bar/candle delay built into the logic (see "hlc3[-3]" bold/underlined references)... Given my limited thinkscripting abilities, I am able to grasp and understand certain basic aspects of the code. However, I am currently unable to make the necessary changes in order to draw the signal on theby netarchitech - Trading Discussion
Robert, Thank you for your latest reply. I continue to be very grateful and appreciative for your time, efforts and expertise in our discussion... QuoteRobert Quotenetarchitech Off topic...what screen capture utility are you are currently using? I'm guessing Techsmith's SnagIt. If so, would you recommend it? You've a good eye for detail. That is exactly the program I am using. Harby netarchitech - Trading Discussion
Robert, Thank you for your recent reply. I really appreciate the additional time, effort and script you've expended trying to find a solution to the linear regression slope - percentage issue... As I review the continuing evolution of this issue, I've come to realize I've always been looking for: 1. linear regression (channel) "length" = 100% (just like LinearRegCh100) 2. retuby netarchitech - Trading Discussion
Robert, Thank you for your recent reply. I greatly appreciate each of your thorough and informative responses, especially since it all started with a "proof of concept"... QuoteRobert If the goal it to plot a 100 period linear regression channel, then LinearRegCH100 is not study to use. That study does a linear regression over the entire length of the chart. The 100 in that studyby netarchitech - Trading Discussion
Robert, Thank you for your latest reply. Based on the latest iteration of the thinkscript you've so generously provided, I've run into what looks to be an anomaly and I'd be interested to hear your thoughts... Essentially, a number of results returned in a scan set do not fit the specified scan condition. For example, using the provided script with the default inputs: # scan for downwardby netarchitech - Trading Discussion
Robert, Thank you for your recent reply. I apologize for the delay with this response. I sincerely appreciate your time, effort, assistance and illustrative documentation to address the LinearRegCh100 slope issue...a tip will be forthcoming I have one follow-up question, if I may... 1. In your proffered script below, if I understand correctly, negative values of angle are converted to pby netarchitech - Trading Discussion
Thank you for your swift reply, mtut. I apologize for not getting back to you before now... To answer your question, I'm looking to define the slope using the TOS-supplied study LinearRegCh100 as shown below...by netarchitech - Trading Discussion
Hello, Is it possible to use thinkscript to simply find the slope of the Linear Regression Channel (LinearRegCh100) and use it in a scan? I've searched all over with no luck... Essentially, I'm interested in creating a condition to determine the slope so I can filter out undesirable results within a larger scan. If I understand correctly, a positive slope would indicate an uptrend and a negby netarchitech - Trading Discussion
I've spent a considerable chunk of my weekend trying to resolve the "Sync Drawings" BUG a/k/a the inability to permanently remove previously deleted, magically reappearing chart drawings. As near as I can tell, the issue revolves around TOS Grids. In any event, I think I've found a solution that appears to have worked for me and thought I would post it for anyone whom mightby netarchitech - Trading Discussion
@robert, Thank you for your informative reply and words of encouragement. I sincerely appreciate it As for the solution to my current dilemma, I reluctantly agree that reversion to multiple MA studies is the only way to proceed, given the inherent limitations of thinkScript. It is frustrating to be sure, but there are other more important battles to fight... Thanks again, @netarchiteby netarchitech - Trading Discussion
I scrapped my original code. As a result of additional research, I came across TOS' MovAvgTwoLines study, which simply plots two MAs on a chart, with only the length parameter available for individual customization. The AverageType also offers a degree of flexibility/customization, but it applies to both MAs globally. I wanted to have all the MAs (whether it be 2 or, in my case, 5) be individuby netarchitech - Trading Discussion