# FVO_Fisher_CCI_Combo (ALSO Called FVO_RAF_UPPER)
# Recycled Indicators - combined by @cos251
# 2020.10.01 - The script will calculate then FisherTransform and CCI in combinationto generate signals
# indicating possible trend. The signals alone are not buy or sell signals but only a
# combination of two indicators to provide indication or trend as they relate to the two
# indicators mentioned.
# Signals GREEN UP ARROW - FT crossed above FTOneBarBack and CCI has crossed above +100
# CYAN UP ARROW - FT crossed above FTOneBarBack and CCI > CCI[1]
# RED DOWN ARROW - FT crossed below FTOneBarBack and CCI has crossed below -100
# RED DOWN ARROW - FT crossed below FTOneBarBack and CCI < CCI[1]
###############################################################################################################
declare upper;
input length = 10;
###### CCI
input lengthCCI = 14;
input over_sold = -100;
input over_bought = 100;
input showBreakoutSignals = no;
################ Work on TICK Charts
def maxHigh_15m;
def minLow_15m;
def range_15m;
rec value_15m;
def truncValue_15m;
def fish_15m;
def FTUpArrow_15m;
def FTDownArrow_15m;
def FTOneBarBack_15m;
def price_15m;
def linDev_15m;
def CCI_15m;
if GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN {
maxHigh_15m = Highest(hl2(), length);
minLow_15m = Lowest(hl2(), length);
range_15m = maxHigh_15m - minLow_15m;
value_15m = if IsNaN(hl2()) then Double.NaN else if IsNaN(range_15m)
then value_15m[1] else if range_15m == 0 then 0 else 0.66 * ((hl2() -
minLow_15m) / range_15m - 0.5) + 0.67 * value_15m[1];
truncValue_15m = if value_15m > 0.99 then 0.999 else if value_15m < -0.99 then -0.999 else value_15m;
fish_15m = 0.5 * (log((1 + truncValue_15m) / (1 - truncValue_15m)) + fish_15m[1]);
FTOneBarBack_15m = fish_15m[1];
FTUpArrow_15m = if (fish_15m[1] < FTOneBarBack_15m[1]) and (fish_15m > FTOneBarBack_15m) then 1 else Double.NaN;
FTDownArrow_15m = if (fish_15m[1] > FTOneBarBack_15m[1]) and (fish_15m < FTOneBarBack_15m) then 1 else Double.Nan;
price_15m = close() + low() + high();
linDev_15m = lindev(price_15m, lengthCCI);
CCI_15m = if linDev_15m == 0 then 0 else (price_15m - Average(price_15m, lengthCCI)) / linDev_15m / 0.015;
} else {
maxHigh_15m = 0;
minLow_15m = 0;
range_15m = 0;
value_15m = 0;
truncValue_15m = 0;
fish_15m = 0;
FTUpArrow_15m = 0;
FTDownArrow_15m = 0;
FTOneBarBack_15m = 0;
price_15m = 0;
linDev_15m = 0;
CCI_15m = 0;
}
# CCI PLOT 1 MINUTE
def CCIUpSignal_15m = if lowest(CCI_15m[1],2) < 100 and CCI_15m > 100 then 1 else Double.Nan;
def CCIDownSignal_15m = if highest(CCI_15m[1],2) > -100 and CCI_15m < -100 then 1 else Double.Nan;
def FTUp_15m = if lowest(fish_15m[1],2) < FTOneBarBack_15m and fish_15m > FTOneBarBack_15m then 1 else Double.NaN;
def FTDOWN_15m = if highest(fish_15m[1],2) > FTOneBarBack_15m and fish_15m < FTOneBarBack_15m then 1 else Double.NaN;
plot comboUP_15m = if CCIUpSignal_15m and FTUp_15m then 1 else double.Nan;
comboUP_15m.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
comboUP_15m.AssignValueColor(Color.GREEN);
plot comboDown_15m = if CCIDownSignal_15m and FTDown_15m then 1 else double.Nan;
comboDown_15m.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
comboDown_15m.AssignValueColor(Color.RED);
plot fishUPCCIUp = if (FTOneBarBack_15m[1] > fish_15m[1] and FTOneBarBack_15m < fish_15m and CCI_15m > CCI_15m[1]) then 1 else Double.Nan;
fishUPCCIUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
fishUPCCIUp.AssignValueColor(Color.CYAN);
plot fishDownCCIDown = if (FTOneBarBack_15m[1] < fish_15m[1] and FTOneBarBack_15m > fish_15m and CCI_15m < CCI_15m[1]) then 1 else Double.Nan;
fishDownCCIDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
fishDownCCIDown.AssignValueColor(Color.LIGHT_RED);