Just joined your forum and I have learnt a lot from your videos and codes.
I was wondering if you could help to create a scan from Fisher Scalper colour indicator bar written by George from The Lawyer Trader (http://thelawyertrader.blogspot.my/2018/04/think-or-swim-indicator-fisher-scalper.html). The code is below and would be great to have scan for bullish and bearish separately.
input price = hl2;
def maxHigh = Highest(price, length);
plot FTOneBarBack = fish;
input emalength = 50;
plot ema2 = expAverage(fish, emalength);
def bullish = if ft > ema2 then 1 else 0;
assignpriceColor(if ft>ftonebarback and bullish then color.green else if ft>ftoneBarBack and bearish then color.blue else if ft<ftoneBarBack and bearish then color.red else if ft<ftOneBarBack and bullish then color.yellow else color.gray);
Marked as spam
Ali, excellent post! You provided the source code and a link to the author of the code. Fantastic. I want everyone to recognize that this is how you post a very good question on the Q&A forum.
Ok, now to the solution. I have looked at the code and determined we have a couple different ways to run the scan. Take a look at the screenshot attached below. Notice the indicator paints the bars of the chart based on Bullish (GREEN) and Bearish (RED). There are other colors on there. But we’ll stick to these two since that is what is being requested.
Be sure to notice the bottom subgraph on the chart. I modified the code to plot the scan signals. I have set the colors to match the painted bars above. A value of 1 means that plot is true, a value of 0 means that plot is false (applies only to the green and red lines).
Scan Method #1
We can scan for this. So when you see a series of green colored bars, we can scan for stocks that are green, regardless of what point within the series of green bars we happen to be at the time. That is scan method number 1.
Scan Method #2
It is possible, that only the first green bar in a series is important. We scan for this too. Notice the Cyan and Magenta colored arrows in the lower subgraph. Those are the points at which the very first bullish or bearish candle is presented. These can be used for scan method number 2.
This code in the lower subgraph contains everything we need to build our scan. Since I know that folks will be asking for it, I am providing the code for that lower subgraph here:
Ok, now let’s present the code you will use for the scan. The changes required are minimal. We just change all the “plot” statements to “def”. Then remove all the style statements associated with those plots. Finally, we add a few lines (eight total) to scan for those signals that used to be plots.
Those of you who have watched at least 2-3 of my videos in the Thinkorswim Scans category recognize I have provided four separate scan signals in the last 8 lines of this code. You will also understand that only one of the four signals can be used at one time and you also know how to switch between them.
Lost? Here is a link to our Thinkorswim Scans category: https://www.hahn-tech.com/category/tos/scans-tos/
Marked as spam
No worries. Thanks again for your participation in our Q&A forum. Looking forward to hearing from you again! Take care.
Good morning Pete; In your 2 scripts for code & scan, you have a line that I do not know what it means. "input price = hl2;" would you kindly explain it's meaning, in this instance. thank you
That was actually provided in the code by the author of this post. Details can be found here: http://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Fundamentals/hl2.html
Please log in to post questions.