Site Meter The Lawyer Trader: April 2018

Tuesday, April 3, 2018

Think or Swim Indicator -- Fisher Scalper Color Bars with Thinkscript

I've got a whole bank of indicators and strategies that I've coded over the years for think or swim and have decided to start randomly posting them along with the codes.  They'll be posted weekly for the next month or two..depends how many good ones I decide are worth posting.

Here's the first and it's an indicator.  The Fisher Scalper Color Bars.  Based on the fisher transform, this indicator is pretty easy to comprehend.  The bars are colored Green (bullish), Yellow (transition from bull to bear), Red (bearish), Blue (bearish transitioning to bullish).

I've played around with this indicator by using it on a higher time frame, like a one hour chart, as seen below, and then taking signals on a lower time frame chart (5m or 15m) in the direction of the trend based on the indicator.

Here's a chart:



Enjoy!

George
(TLT)

Here's the thinkscript code.

***delete this line***
declare lower;

input price = hl2;
input length = 10;

def maxHigh = Highest(price, length);
def minLow = Lowest(price, length);
def range = maxHigh - minLow;
rec value = if IsNaN(price)
    then Double.NaN
    else if IsNaN(range)
        then value[1]
        else if range == 0
            then 0
            else 0.66 * ((price - minLow) / range - 0.5) + 0.67 * value[1];
def truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
rec fish = 0.5 * (log((1 + truncValue) / (1 - truncValue)) + fish[1]);

plot FTOneBarBack = fish[1];
plot FT = fish;
plot ZeroLine = 0;

input emalength = 50;

plot ema2 = expAverage(fish, emalength);

FTOneBarBack.SetDefaultColor(GetColor(1));
FT.SetDefaultColor(GetColor(8));
ZeroLine.SetDefaultColor(GetColor(5));

def bullish = if ft > ema2 then 1 else 0;
def bearish = 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);

***delete this line***