Alerts for Fisher Transform crossovers?

Ian_Tai

New member
I've been using the Fisher Transform with amount of success. Wondering if anyone has a version with an audible alert when the Fisher Transform Indicator crosses. I've looked high and low. But doesn't seem to exist.
 

BenTen

Administrative
Staff member
Staff
VIP
Try this:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2019
#

declare lower;

input price = hl2;
input length = 10;

def maxHigh = Highest(price, length);
def minLow = Lowest(price, length);
def range = maxHigh - minLow;
def 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;
def fish = 0.5 * (log((1 + truncValue) / (1 - truncValue)) + fish[1]);

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

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

def bull_cross = FT crosses above FTOneBarBack;
def bear_cross = FT crosses below FTOneBarBack;

# Alerts
Alert(bull_cross, " ", Alert.Bar, Sound.Chimes);
Alert(bear_cross, " ", Alert.Bar, Sound.Bell);
 

Ian_Tai

New member
Thank you. Before posting I figured out Arrows to mark the cross. Here's the entire code:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2019
#

declare lower;

input price = hl2;
input length = 10;

def maxHigh = Highest(price, length);
def minLow = Lowest(price, length);
def range = maxHigh - minLow;
def 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;
def fish = 0.5 * (log((1 + truncValue) / (1 - truncValue)) + fish[1]);

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

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

def bull_cross = FT crosses above FTOneBarBack;
def bear_cross = FT crosses below FTOneBarBack;


plot arrow = if FT crosses above FTOneBarBack then fish else Double.NaN;
arrow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
arrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
arrow.SetDefaultColor(Color.GREEN);

plot arrowD = if FT crosses below FTOneBarBack then fish else Double.NaN;
arrowD.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
arrowD.SetPaintingStrategy(PaintingStrategy.ARROW_Down);
arrowD.SetDefaultColor(Color.RED);
# Alerts
Alert(bull_cross, " ", Alert.Bar, Sound.Chimes);
Alert(bear_cross, " ", Alert.Bar, Sound.Bell);
 
Last edited by a moderator:

Similar threads

Top