## Archive Name: TrueMomentumOscilWithFisher_v04_JQ
## Archive Section:
## Suggested Tos Name: TrueMomentumOscilWithFisher_v04_JQ
## Archive Date: 10.6.2018
## Archive Notes:
# v02 JQ added FE code to generate points
# v03 JQ added FisherTransform crossover arrows to confirm TMO
# v04 JQ Remoed all Fractal Energy code
## "##" indicates an addition by the Archivist
# dart966 added MTF
# TMO ((T)rue (M)omentum (O)scilator)
# Mobius
# V01.05.2018
#hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.
declare lower;
input customSymbol = "VIX"; # 'Index symbol'
input Aggregation1 = AggregationPeriod.FIVE_MIN;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input displayFisherLabels = no;
def o = open(symbol = customSymbol, period = Aggregation1);
def c = close(symbol = customSymbol, period = Aggregation1);
def data = fold i = 0 to length
with s
do s + (if c > GetValue(o, i)
then 1
else if c < GetValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.HideBubble();
Signal.HideTitle();
AddCloud(Main, Signal, Color.GREEN, Color.RED);
plot zero = if IsNaN(c) then Double.NaN else 0;
zero.SetDefaultColor(Color.GRAY);
zero.HideBubble();
zero.HideTitle();
plot ob = if IsNaN(c) then Double.NaN else Round(length * .7);
ob.SetDefaultColor(Color.GRAY);
ob.HideBubble();
ob.HideTitle();
plot os = if IsNaN(c) then Double.NaN else -Round(length * .7);
os.SetDefaultColor(Color.GRAY);
os.HideBubble();
os.HideTitle();
AddCloud(ob, length, Color.LIGHT_RED, Color.LIGHT_RED, no);
AddCloud(-length, os, Color.LIGHT_GREEN, Color.LIGHT_GREEN);
# End Code TMO
# JQ_FisherTransform_wLabels v02
# assistance provided by AlphaInvestor, amalia, randyr and nube
# v02 9.23.2018 JQ added arrows
input Fisherprice = hl2;
input FisherLength = 10;
input TriggerLineOffset = 1; # Ehler's value of choice is 1
input TriggerLine_Color_Choice = {"magenta", "cyan", "pink", default "gray", "Mustard", "red", "green", "dark_gray", "Pale Yellow", "white"};
input deBug = no;
input BuyLabelText = " FisherTransform Buy ";
input SellLebelText = " FisherTransform Sell ";
def maxHigh = Highest(Fisherprice, FisherLength);
def minLow = Lowest(Fisherprice, FisherLength);
def range = maxHigh - minLow;
def value = if IsNaN(Fisherprice)
then Double.NaN
else if IsNaN(range)
then value[1]
else if range == 0
then 0
else 0.66 * ((Fisherprice - 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]);
def FTOneBarBack = fish[TriggerLineOffset];
def FT = fish;
plot FisherBullCross = if FT crosses above FTOneBarBack then lowestall(Main) else Double.NaN;
FisherBullCross.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
FisherBullCross.SetDefaultColor(Color.UPTICK);
plot FisherBearCross = if FT crosses below FTOneBarBack then highestall(Main) else Double.NaN;
FisherBearCross.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
FisherBearCross.SetDefaultColor(Color.DOWNTICK);
AddLabel (displayFisherLabels, "" + if FT >= FTOneBarBack then BuyLabelText else SellLebelText + " ",
(if FT > FTOneBarBack
then Color.LIGHT_GREEN
else if FT < FTOneBarBack
then Color.LIGHT_RED
else Color.GRAY));
# End Fisher Transform Code