YungTrader's Ultimate Indicator

Status
Not open for further replies.
Here's the new release:
It looks to find the biggest breakouts and breakdowns, this means it will miss some good ones that start small, but will also sort through most of the weaker breakouts. I don't have time to make the scanner tonight but the biggest result of this will be the scannable conditions that I've used to make this study. It will help scan through most of the junk and locate the good fe and he set ups. Also for those of you who don't really understand the application of much of this is pretty much does all of the work for you.

Next Step Big Improvement Coming:
My next goal is to make the criteria more lenient if the stock is more trending. Some of the best breakouts are missed because the study looks for upward movement in the he and downward movement in the fe but there is no more room to run because the stock has been trending for a while.

Here's one picture example:
Code:
declare upper;
input ThresholdMult = 4;
input LookbackLength = 4;
input LookbackPeriod = 4;
input TimeFrame2 = {"15 MIN", "1 MIN", "2 MIN", "3 MIN", "4 MIN", "5 MIN", "10 MIN", "20 MIN", "30 MIN", "1 HOUR", "2 HOURS", "4 HOURS", DAY, "2 DAYS", "3 DAYS", "4 DAYS", default WEEK, MONTH, "OPT EXP"};
input TimeFrame3 = {"30 MIN", "1 MIN", "2 MIN", "3 MIN", "4 MIN", "5 MIN", "10 MIN", "15 MIN", "20 MIN", "1 HOUR", "2 HOURS", "4 HOURS", DAY, "2 DAYS", "3 DAYS", "4 DAYS", WEEK, default MONTH, "OPT EXP"};
input HideSwings = no;
input HideCurrentTF = no;
input HideTimeFrame2 = no;
input HideTimeFrame3 = no;
input conso = .02;
input outo = .01;
input length222 = 4;
input averageType4 = AverageType.WILDERS;

def ATR = MovingAverage(averageType4, TrueRange(high / close, close / close, low / close) * 100, length222);

def BuyEntry5 = 15;
def SellEntry5 = 15;

def QB5 = Highest(ATR, BuyEntry5);
def QS5 = Lowest(ATR, SellEntry5);
def xxx = QB5[1];
def bbb = QS5[1];
def midline3 = (xxx + bbb) / 2;

def price = close;
def SwingsLagBar = 1;
def BuyEntry = 3;
def SellEntry = 3;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);
plot xx = QB[1];
plot bb = QS[1];
plot midline = (QB[1] + QS[1]) / 2;
def length = 1;
def displace = 0;
def price4 = close;
def SMA = Average(price4[-displace], length);

#--------------------------------------------------------------
def _highInPeriod1 = Highest(high, LookbackPeriod);
def _lowInPeriod1 = Lowest(low, LookbackPeriod);
#--------------------------------------------------------------
def marketLow1 = if _lowInPeriod1 < _lowInPeriod1[-LookbackPeriod] then _lowInPeriod1 else _lowInPeriod1[-LookbackPeriod];
def _markedLow1 = low == marketLow1;

rec _lastMarkedLow1 = CompoundValue(1, if IsNaN(_markedLow1) then _lastMarkedLow1[1] else if _markedLow1 then low else _lastMarkedLow1[1], low);
#--------------------------------------------------------------
def marketHigh1 = if _highInPeriod1 > _highInPeriod1[-LookbackPeriod] then _highInPeriod1 else _highInPeriod1[-LookbackPeriod];
def _markedHigh1 = high == marketHigh1;

rec _lastMarkedHigh1 = CompoundValue(1, if IsNaN(_markedHigh1) then _lastMarkedHigh1[1] else if _markedHigh1 then high else _lastMarkedHigh1[1], high);
#--------------------------------------------------------------
plot Resistance1 = _lastMarkedHigh1;
plot Support1 = _lastMarkedLow1;
#--------------------------------------------------------------
Resistance1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Resistance1.SetDefaultColor(Color.MAGENTA);
Resistance1.SetHiding(HideCurrentTF);
#--------------------------------------------------------------
Support1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Support1.SetDefaultColor(Color.YELLOW);
Support1.SetHiding(HideCurrentTF);
#--------------------------------------------------------------
def LowSwingForw = Lowest(low, SwingsLagBar)[-SwingsLagBar];
def LowSwingBack = Lowest(low, LookbackPeriod)[1];
def SwingLow = if low < LowSwingForw and low <= LowSwingBack then 1 else 0;
plot LowSwing = if SwingLow then low else Double.NaN;
LowSwing.Hide();
#--------------------------------------------------------------
def HighSwingForw = Highest(high, SwingsLagBar)[-SwingsLagBar];
def HighSwingBack = Highest(high, LookbackPeriod)[1];
def SwingHigh = if high > HighSwingForw and high >= HighSwingBack then 1 else 0;
plot HighSwing = if SwingHigh then high else Double.NaN;
HighSwing.Hide();
#--------------------------------------------------------------
HighSwing.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
HighSwing.SetLineWeight(5);
HighSwing.SetDefaultColor(Color.MAGENTA);
HighSwing.SetHiding(HideSwings);
LowSwing.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
LowSwing.SetLineWeight(5);
LowSwing.SetDefaultColor(Color.YELLOW);
LowSwing.SetHiding(HideSwings);
#--------------------------------------------------------------
Alert(HighSwing, "SupRes : Swing High", Alert.BAR, Sound.Bell);
Alert(LowSwing, "SupRes : Swing Low", Alert.BAR, Sound.Bell);
#--------------------------------------------------------------
AddLabel(HighSwing, "SupRes : Swing High", Color.MAGENTA);
AddLabel(LowSwing, "SupRes : Swing Low", Color.YELLOW);
#--------------------------------------------------------------
def _highInPeriod2 = Highest(high(period = TimeFrame2), LookbackPeriod);
def _lowInPeriod2 = Lowest(low(period = TimeFrame2), LookbackPeriod);
#--------------------------------------------------------------
def marketLow2 = if _lowInPeriod2 < _lowInPeriod2[-LookbackPeriod] then _lowInPeriod2 else _lowInPeriod2[-LookbackPeriod];
def _markedLow2 = low(period = TimeFrame2) == marketLow2;

rec _lastMarkedLow2 = CompoundValue(1, if IsNaN(_markedLow2) then _lastMarkedLow2[1] else if _markedLow2 then low(period = TimeFrame2) else _lastMarkedLow2[1], low(period = TimeFrame2));
#--------------------------------------------------------------
def marketHigh2 = if _highInPeriod2 > _highInPeriod2[-LookbackPeriod] then _highInPeriod2 else _highInPeriod2[-LookbackPeriod];
def _markedHigh2 = high(period = TimeFrame2) == marketHigh2;

rec _lastMarkedHigh2 = CompoundValue(1, if IsNaN(_markedHigh2) then _lastMarkedHigh2[1] else if _markedHigh2 then high(period = TimeFrame2) else _lastMarkedHigh2[1], high(period = TimeFrame2));
#--------------------------------------------------------------
plot Resistance2 = _lastMarkedHigh2;
Resistance2.Hide();
plot Support2 = _lastMarkedLow2;
Support2.Hide();
#--------------------------------------------------------------
Resistance2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Resistance2.SetDefaultColor(Color.MAGENTA);
Resistance2.SetHiding(HideTimeFrame2);
#--------------------------------------------------------------
Support2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Support2.SetDefaultColor(Color.YELLOW);
Support2.SetHiding(HideTimeFrame2);
#--------------------------------------------------------------
def _highInPeriod3 = Highest(high(period = TimeFrame3), LookbackPeriod);
def _lowInPeriod3 = Lowest(low(period = TimeFrame3), LookbackPeriod);
#--------------------------------------------------------------
def marketLow3 = if _lowInPeriod3 < _lowInPeriod3[-LookbackPeriod] then _lowInPeriod3 else _lowInPeriod3[-LookbackPeriod];
def _markedLow3 = low(period = TimeFrame3) == marketLow3;

rec _lastMarkedLow3 = CompoundValue(1, if IsNaN(_markedLow3) then _lastMarkedLow3[1] else if _markedLow3 then low(period = TimeFrame3) else _lastMarkedLow3[1], low(period = TimeFrame3));
#--------------------------------------------------------------
def marketHigh3 = if _highInPeriod3 > _highInPeriod3[-LookbackPeriod] then _highInPeriod3 else _highInPeriod3[-LookbackPeriod];
def _markedHigh3 = high(period = TimeFrame3) == marketHigh3;

rec _lastMarkedHigh3 = CompoundValue(1, if IsNaN(_markedHigh3) then _lastMarkedHigh3[1] else if _markedHigh3 then high(period = TimeFrame3) else _lastMarkedHigh3[1], high(period = TimeFrame3));
#--------------------------------------------------------------
plot Resistance3 = _lastMarkedHigh3;
Resistance3.Hide();
plot Support3 = _lastMarkedLow3;
Support3.Hide();
#--------------------------------------------------------------
Resistance3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Resistance3.SetDefaultColor(Color.MAGENTA);
Resistance3.SetHiding(HideTimeFrame3);
#--------------------------------------------------------------
Support3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Support3.SetDefaultColor(Color.YELLOW);
Support3.SetHiding(HideTimeFrame3);

input nFE1 = 1;
input nfe2 = 2;
input nfe3 = 3;
input nfe4 = 4;
input nfe5 = 5;
input nfe6 = 6;
input nfe7 = 7;
input nfe8 = 8;
input nfe9 = 9;
input nfe10 = 10;
input nfe11 = 11;
input nfe12 = 12;
input nfe13 = 13;
input nfe14 = 14;
input nfe15 = 15;
input nfe16 = 16;
input nfe17 = 17;
input nfe18 = 18;
input nfe19 = 19;
input nfe20 = 20;


# Calculations
def gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE1) /
        (Highest(high, nFE1) - Lowest(low, nFE1)))
            / Log(nFE1);
def gamma2 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe2) /
        (Highest(high, nfe2) - Lowest(low, nfe2)))
            / Log(nfe2);
def gamma3 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe3) /
        (Highest(high, nfe3) - Lowest(low, nfe3)))
            / Log(nfe3);
def gamma4 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe4) /
        (Highest(high, nfe4) - Lowest(low, nfe4)))
            / Log(nfe4);
def gamma5 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe5) /
        (Highest(high, nfe5) - Lowest(low, nfe5)))
            / Log(nfe5);
def gamma6 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe6) /
        (Highest(high, nfe6) - Lowest(low, nfe6)))
            / Log(nfe6);
def gamma7 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe7) /
        (Highest(high, nfe7) - Lowest(low, nfe7)))
            / Log(nfe7);
def gamma8 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe8) /
        (Highest(high, nfe8) - Lowest(low, nfe8)))
            / Log(nfe8);
def gamma9 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe9) /
        (Highest(high, nfe9) - Lowest(low, nfe9)))
            / Log(nfe9);
def gamma10 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe10) /
        (Highest(high, nfe10) - Lowest(low, nfe10)))
            / Log(nfe10);
def gamma11 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe11) /
        (Highest(high, nfe11) - Lowest(low, nfe11)))
            / Log(nfe11);
def gamma12 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe12) /
        (Highest(high, nfe12) - Lowest(low, nfe12)))
            / Log(nfe12);
def gamma13 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe13) /
        (Highest(high, nfe13) - Lowest(low, nfe13)))
            / Log(nfe13);
def gamma14 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe14) /
        (Highest(high, nfe14) - Lowest(low, nfe14)))
            / Log(nfe14);
def gamma15 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe15) /
        (Highest(high, nfe15) - Lowest(low, nfe15)))
            / Log(nfe15);
def gamma16 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe16) /
        (Highest(high, nfe16) - Lowest(low, nfe16)))
            / Log(nfe16);
def gamma17 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe17) /
        (Highest(high, nfe17) - Lowest(low, nfe17)))
            / Log(nfe17);
def gamma18 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe18) /
        (Highest(high, nfe18) - Lowest(low, nfe18)))
            / Log(nfe18);
def gamma19 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe19) /
        (Highest(high, nfe19) - Lowest(low, nfe19)))
            / Log(nfe19);
def gamma20 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nfe20) /
        (Highest(high, nfe20) - Lowest(low, nfe20)))
            / Log(nfe20);

def gammasector1 = (gamma2 + gamma3 + gamma4 + gamma5) / 4;
def gammasector2 = (gamma6 + gamma7 + gamma8 + gamma9 + gamma10) / 5;
def gammasector3 = (gamma11 + gamma12 + gamma13 + gamma14 + gamma15) / 5;
def gammasector4 = (gamma16 + gamma17 + gamma18 + gamma19 + gamma20) / 5;

def twoofthree3 = (gammasector2[1] > gammasector2) or (gammasector3[1] > gammasector3);
def twoofthree2 =  (gammasector2[1] > gammasector2) and (gammasector4[1] > gammasector4);
def twoofthree = twoofthree3 or twoofthree2;

def feblast = gammasector1[1] > gammasector1 and gammasector2[1] > gammasector2 and gammasector3[1] > gammasector3 and gammasector4[1] > gammasector4;




def break3 = (gammasector1[1] > gammasector1) and (gammasector2[1] > gammasector2) and (gammasector3[1] > gammasector3) and (gammasector4[1] > gammasector4);



def lower_close1 = (SMA crosses below Support1[1]);
def higher_close1 = (SMA crosses above Resistance1[1]);
def lower_close2 = (SMA crosses below Support2[1]);
def higher_close2 = (SMA crosses above Resistance2[1]);
def lower_close3 = (SMA crosses below Support2[1]);
def higher_close3 = (SMA crosses above Resistance2[1]);

def x = (hl2 > xx);
def c = (close[1] < xx[1]);
def v = (close[2] < xx[2]);
def b = x and (c or v);

def y = (close > bb);
def w = (close[1] < bb[1]);
def e = (close[2] < bb[2]);
def r = y and (w or e);

def allbreakdown = lower_close1 or lower_close2 or lower_close3;
def allbreakup =  (higher_close1 or higher_close2 or higher_close3);

input BuyEntry2 = 5;
input SellEntry2 = 5;

def QB2 = Highest(high, BuyEntry2);
def QS2 = Lowest(low, SellEntry2);
plot trueqb2 = QB2[1];
trueqb2.SetDefaultColor(GetColor(27));
plot trueqs2 = QS2[1];
trueqs2.SetDefaultColor(GetColor(27));
def ath = (((trueqb2 - trueqb2[10]) / 100) < .10);
def atl = (((trueqs2 - trueqs2[10]) / 100) >= -.10);


def length67 = 10;
def displace2 = 0;
def AvgExp = ExpAverage(price[-displace2], length67);

input length69 = 4;
def factor = .869;
input mode = {default Range, ATR};

def range;
switch (mode) {
case Range:
    range = Highest(high, length69) - Lowest(low, length69);
case ATR:
    range = reference ATR();
}

def RangeRatio = (range / range[length69]) / 20;
def RangeFactor = factor / 20;
def goodtrade = RangeRatio[1] < RangeFactor[1] and RangeRatio > RangeFactor;
def badhammer = (((high - close) < ((close + open) / 2) - low)) and (open > QB[1]);


plot comboupstrongstrongstrong = (high > QB[1]) and (c[1] < QB[2]) and (((high - QB[1]) / 100) < outo) and (((QB[1] - AvgExp) / 100) < conso) and (low < midline[1]);

plot comboupstrongstrong = (high > QB[1]) and (c[1] < QB[2]) and (((open - QB[1]) / 100) < outo) and (((QB[1] - AvgExp) / 100) < conso) and (open[1] or open[2] or open[3] < midline) and comboupstrongstrongstrong is false and (open < QB[1]) and (open[1] > QS[2]) and (close[1] < midline[2]);

plot comboupstrong = (high > QB[1]) and (close[1] < QB[2]) and (((open - QB[1]) / 100) < outo) and (((QB[1] - AvgExp) / 100) < conso)  and comboupstrongstrongstrong is false and comboupstrongstrong is false and (high > open) and (low < midline) and (high > open);

def any = comboupstrong or comboupstrongstrong or comboupstrongstrongstrong;
def fg = (high - close) < ((close - open) * 2);
def fgbear = (close - low) < ((open - close) * 2);
def goodcandle = ((high - close) < (hl2 - low)) or (open > high[1]);
def goodsellcandle = (close - low) < (high - hl2);
def allfe = ((gammasector1 + gammasector2 + gammasector3 + gammasector4) / 4);

def length6969 = 5;
input length13 = 16;
input length1 = 4;
input length2 = 5;
input length3 = 6;
input length4 = 7;
input length5 = 8;
input length6 = 9;
input length7 = 10;
input length8 = 11;
input length9 = 12;
input length10 = 13;
input length11 = 14;
input length12 = 15;

input averageType = AverageType.EXPONENTIAL;
input lengthave = 2;



def ll = Lowest(low, length1);
def hh = Highest(high, length1);
def atr1 = MovingAverage(averageType, TrueRange(high, close, low), length1);
def tmp_H = (Log(hh - ll) - Log(atr1)) / (Log(length1));

def H;
if tmp_H > 1
then {
    H = 1;
} else if tmp_H < 0 {
    H = 0;
} else {
    H = tmp_H;
}
def ll2 = Lowest(low, length2);
def hh2 = Highest(high, length2);
def atr2 = MovingAverage(averageType, TrueRange(high, close, low), length2);
def tmp_H2 = (Log(hh2 - ll2) - Log(atr2)) / (Log(length2));

def H2;
if tmp_H2 > 1
then {
    H2 = 1;
} else if tmp_H2 < 0 {
    H2 = 0;
} else {
    H2 = tmp_H2;
}
def ll3 = Lowest(low, length3);
def hh3 = Highest(high, length3);
def atr3 = MovingAverage(averageType, TrueRange(high, close, low), length3);
def tmp_H3 = (Log(hh3 - ll3) - Log(atr3)) / (Log(length3));

def H3;
if tmp_H3 > 1
then {
    H3 = 1;
} else if tmp_H3 < 0 {
    H3 = 0;
} else {
    H3 = tmp_H3;
}

def ll4 = Lowest(low, length4);
def hh4 = Highest(high, length4);
def atr4 = MovingAverage(averageType, TrueRange(high, close, low), length4);
def tmp_H4 = (Log(hh4 - ll4) - Log(atr4)) / (Log(length4));

def H4;
if tmp_H4 > 1
then {
    H4 = 1;
} else if tmp_H4 < 0 {
    H4 = 0;
} else {
    H4 = tmp_H4;
}

def ll5 = Lowest(low, length5);
def hh5 = Highest(high, length5);
def atr5 = MovingAverage(averageType, TrueRange(high, close, low), length5);
def tmp_H5 = (Log(hh5 - ll5) - Log(atr5)) / (Log(length5));

def H5;
if tmp_H5 > 1
then {
    H5 = 1;
} else if tmp_H5 < 0 {
    H5 = 0;
} else {
    H5 = tmp_H5;
}

def ll6 = Lowest(low, length6);
def hh6 = Highest(high, length6);
def atr6 = MovingAverage(averageType, TrueRange(high, close, low), length6);
def tmp_H6 = (Log(hh6 - ll6) - Log(atr6)) / (Log(length6));

def H6;
if tmp_H6 > 1
then {
    H6 = 1;
} else if tmp_H6 < 0 {
    H6 = 0;
} else {
    H6 = tmp_H6;
}

def ll7 = Lowest(low, length7);
def hh7 = Highest(high, length7);
def atr7 = MovingAverage(averageType, TrueRange(high, close, low), length7);
def tmp_H7 = (Log(hh7 - ll7) - Log(atr7)) / (Log(length7));

def H7;
if tmp_H7 > 1
then {
    H7 = 1;
} else if tmp_H7 < 0 {
    H7 = 0;
} else {
    H7 = tmp_H7;
}

def ll8 = Lowest(low, length8);
def hh8 = Highest(high, length8);
def atr8 = MovingAverage(averageType, TrueRange(high, close, low), length8);
def tmp_h8 = (Log(hh8 - ll8) - Log(atr8)) / (Log(length8));

def H8;
if tmp_h8 > 1
then {
    H8 = 1;
} else if tmp_h8 < 0 {
    H8 = 0;
} else {
    H8 = tmp_h8;
}

def ll9 = Lowest(low, length9);
def hh9 = Highest(high, length9);
def atr9 = MovingAverage(averageType, TrueRange(high, close, low), length9);
def tmp_H9 = (Log(hh9 - ll9) - Log(atr9)) / (Log(length9));

def H9;
if tmp_H9 > 1
then {
    H9 = 1;
} else if tmp_H9 < 0 {
    H9 = 0;
} else {
    H9 = tmp_H9;
}

def ll10 = Lowest(low, length10);
def hh10 = Highest(high, length10);
def atr10 = MovingAverage(averageType, TrueRange(high, close, low), length10);
def tmp_H10 = (Log(hh10 - ll10) - Log(atr10)) / (Log(length10));

def H10;
if tmp_H10 > 1
then {
    H10 = 1;
} else if tmp_H10 < 0 {
    H10 = 0;
} else {
    H10 = tmp_H10;
}

def ll11 = Lowest(low, length11);
def hh11 = Highest(high, length11);
def atr11 = MovingAverage(averageType, TrueRange(high, close, low), length11);
def tmp_H11 = (Log(hh11 - ll11) - Log(atr11)) / (Log(length11));

def H11;
if tmp_H11 > 1
then {
    H11 = 1;
} else if tmp_H11 < 0 {
    H11 = 0;
} else {
    H11 = tmp_H11;
}

def ll12 = Lowest(low, length12);
def hh12 = Highest(high, length12);
def atr12 = MovingAverage(averageType, TrueRange(high, close, low), length12);
def tmp_H12 = (Log(hh12 - ll12) - Log(atr12)) / (Log(length12));

def H12;
if tmp_H12 > 1
then {
    H12 = 1;
} else if tmp_H12 < 0 {
    H12 = 0;
} else {
    H12 = tmp_H12;
}

def ll13 = Lowest(low, length13);
def hh13 = Highest(high, length13);
def atr13 = MovingAverage(averageType, TrueRange(high, close, low), length13);
def tmp_H13 = (Log(hh13 - ll13) - Log(atr13)) / (Log(length13));

def H13;
if tmp_H13 > 1
then {
    H13 = 1;
} else if tmp_H13 < 0 {
    H13 = 0;
} else {
    H13 = tmp_H13;
}


plot gamma_max = Max(gamma4, Max(gamma5,
    Max(gamma6, Max(gamma7, Max(gamma8, Max(gamma9, Max(gamma10,
    Max(gamma11, Max(gamma12, Max(gamma13, Max(gamma14, gamma15)))))))))));

plot gamma_min = Min(gamma4, Min(gamma5,
    Min(gamma6, Min(gamma7, Min(gamma8, Min(gamma9, Min(gamma10,
    Min(gamma11, Min(gamma12, Min(gamma13, Min(gamma14, gamma15)))))))))));




def he_max = max(h, max(h2, max(h3,
    max(h4, max(h5, max(h6, max(h7, max(h8,
    max(h9, max(h10, max(h11, h12)))))))))));

def he_min = min(h, min(h2, min(h3,
    min(h4, min(h5, min(h6, min(h7, min(h8,
    min(h9, min(h10, min(h11, h12)))))))))));



def AverageOverRange = SImpleMovingAvg(price = (high[1] - low[1]), length = lookbackLength);

def CurrentRange = high - low;

plot tallCandle = if CurrentRange <= (AverageOverRange * ThresholdMult) then 1 else double.nan;


def f_prime = (gamma_min * -1) + 1;
def f_prime2 = (gamma_max * -1) + 1;
def bothlow = (he_min + f_prime2) / 2;
def bothup = (he_max + f_prime) / 2;
def displacement1 = (bothlow - bothlow[1]);
def displacement12 = bothup - bothup[1];
def ni = .12;
def buy = ((displacement1 + displacement12) / 2 > .12) or (displacement1 > .13 and displacement12 - displacement12[1] > .02) or (displacement12 > .13 and displacement1 - displacement1[1] > .02);
def decengtcand = if (close > open and (high - close > close - open) and (open - low < close - close)) then 1 else 0;
def decengtcand2 = if (close < open and (high - close > close - open)) then 1 else 0;

plot goldenbuywfe = ((allbreakup or (allbreakup[1] and tallcandle[1]) or (allbreakup[2] and tallcandle[2]))) and (buy or buy[1]) and (decengtcand is false and decengtcand2 is false);
goldenbuywfe.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
goldenbuywfe.SetDefaultColor(GetColor(8));
def goldenbuywfetest = ((allbreakup or allbreakup[1]));
plot goldenshort = ((allbreakdown)) and (buy or buy[1]) and close < open;
goldenshort.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
goldenshort.SetDefaultColor(GetColor(39));
#plot regularshort = ((allbreakdown or allbreakdown[1] or allbreakdown[2])) and fgbear;
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Testing new setup. Used one of your older scanners and jumped in $TTOO and $CVE. $CVE didnt have the buy arrow but it broke $4.00 and has a gapfill to $5.84 so i decided to take it. $TTOO has the buy arrow but is very volatile. i also jumped into $TTOO a little late. Should be interesting. I have more faith in $CVE but we shall see. I wish i would of got into $HEXO when it came on the scanner premarket as its now up 50%. Oh well. lol
 
@martyrjohn - To volatile at open, I trade after 9am CST to let the noise die down (helps to ward against false signals IMHO).
1. Only trade stocks above the cloud, Ichimoku
2. ADX > 30
3. DMI + > 25, - < 15

Start playing around with Hammond B3 & MOBO (modified Bollinger bands)

I used MOBO today and it worked pretty well. Do you think there could be a way to use yungtraders breakout scan and in that scan, scan for MOBO up arrows? This way I don't have to go through every stock waiting for a pullback up arrow. I tried to do this and it said "complexity may result in not reliable data" or something along the lines of that.
 
Sold my $TTOO position for small gain in at .627 and out .67. Almost 8% gain on that one. Not a fan of that stock and dont like second day plays after buy signal on the TTOO chart. Definitely left profits as it went to .70 so far. Oh well, rather take profits and grab some singles. Still holding $CVE and will be holding O/N.
 
Sold my $TTOO position for small gain in at .627 and out .67. Almost 8% gain on that one. Not a fan of that stock and dont like second day plays after buy signal on the TTOO chart. Definitely left profits as it went to .70 so far. Oh well, rather take profits and grab some singles. Still holding $CVE and will be holding O/N.
@Juston410 May I ask which scanner you used ? which #post ? thank you
 
#The is the one i use.
Code:
input LookbackPeriod = 4;
input TimeFrame2 = "day";
input TimeFrame3 = "day";
input HideSwings = no;
input HideCurrentTF = no;
input HideTimeFrame2 = no;
input HideTimeFrame3 = no;
input conso = .02;
input outo = .01;
def price = close;
def SwingsLagBar = 1;
input nFE1 = 1;
input nfe2 = 2;
input nfe3 = 3;
input nfe4 = 4;
input nfe5 = 5;
input nfe6 = 6;
input nfe7 = 7;
input nfe8 = 8;
input nfe9 = 9;
input nfe10 = 10;
input nfe11 = 11;
input nfe12 = 12;
input nfe13 = 13;
input nfe14 = 14;
input nfe15 = 15;
input nfe16 = 16;
input nfe17 = 17;
input nfe18 = 18;
input nfe19 = 19;
input nfe20 = 20;
def gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE1) /
        (Highest(high, nFE1) - Lowest(low, nFE1)))
            / Log(nFE1);
def gamma2 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE2) /
        (Highest(high, nFE2) - Lowest(low, nFE2)))
            / Log(nFE2);
def gamma3 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE3) /
        (Highest(high, nFE3) - Lowest(low, nFE3)))
            / Log(nFE3);
def gamma4 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE4) /
        (Highest(high, nFE4) - Lowest(low, nFE4)))
            / Log(nFE4);
def gamma5 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE5) /
        (Highest(high, nFE5) - Lowest(low, nFE5)))
            / Log(nFE5);
def gamma6 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE6) /
        (Highest(high, nFE6) - Lowest(low, nFE6)))
            / Log(nFE6);
def gamma7 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE7) /
        (Highest(high, nFE7) - Lowest(low, nFE7)))
            / Log(nFE7);
def gamma8 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE8) /
        (Highest(high, nFE8) - Lowest(low, nFE8)))
            / Log(nFE8);
def gamma9 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE9) /
        (Highest(high, nFE9) - Lowest(low, nFE9)))
            / Log(nFE9);
def gamma10 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE10) /
        (Highest(high, nFE10) - Lowest(low, nFE10)))
            / Log(nFE10);
def gamma11 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE11) /
        (Highest(high, nFE11) - Lowest(low, nFE11)))
            / Log(nFE11);
def gamma12 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE12) /
        (Highest(high, nFE12) - Lowest(low, nFE12)))
            / Log(nFE12);
def gamma13 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE13) /
        (Highest(high, nFE13) - Lowest(low, nFE13)))
            / Log(nFE13);
def gamma14 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE14) /
        (Highest(high, nFE14) - Lowest(low, nFE14)))
            / Log(nFE14);
def gamma15 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE15) /
        (Highest(high, nFE15) - Lowest(low, nFE15)))
            / Log(nFE15);
def gamma16 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE16) /
        (Highest(high, nFE16) - Lowest(low, nFE16)))
            / Log(nFE16);
def gamma17 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE17) /
        (Highest(high, nFE17) - Lowest(low, nFE17)))
            / Log(nFE17);
def gamma18 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE18) /
        (Highest(high, nFE18) - Lowest(low, nFE18)))
            / Log(nFE18);
def gamma19 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE19) /
        (Highest(high, nFE19) - Lowest(low, nFE19)))
            / Log(nFE19);
def gamma20 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE20) /
        (Highest(high, nFE20) - Lowest(low, nFE20)))
            / Log(nFE20);

def gammasector1 = (gamma2 + gamma3 + gamma4)/3;
def gammasector2 = (gamma6 + gamma7 + gamma8 + gamma9 + gamma10)/5;
def gammasector3 = (gamma11 + gamma12 + gamma13 + gamma14 + gamma15)/5;
def gammasector4 = (gamma16 + gamma17 + gamma18 + gamma19 + gamma20)/5;

def trending = (gammasector1 < gammasector1[1] or gammasector1[1] < .35) and (gammasector1 < .6);
# KAUFMANEFFICIENCYRATIO 
# (c) 2009 http://www.thinkscripter.com
# [email protected]
# Last Update 16 MAR 2009

declare lower;

input length69 = 7;
input lowerERThreshold = -11;
input upperERThreshold = 11;
input movingAvePeriod = 35;
input movingAvePeriod2 = 10;
input movingAvePeriod3 = 2;


def NetChange = hl2 - hl2[length69];

def incrementalTotalChange = AbsValue(hl2 - hl2[1]);
def TotalChange = Sum(incrementalTotalChange, length69);

def ERatio = (NetChange / TotalChange) * 100;

def ave = ExpAverage(ERatio, movingAvePeriod);
def ave2 = ExpAverage(ERatio, movingAvePeriod2);
def ave3 = ExpAverage(ERatio, movingAvePeriod3);

def ER = ERatio;
def BuyEntry = 3;
def SellEntry = 3;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);
def xx = QB[1];
def bb = QS[1];
def length = 1;
def displace = 0;
def price4 = close;
def SMA = Average(price4[-displace], length);

#--------------------------------------------------------------
def _highInPeriod1 = Highest(high, LookbackPeriod);
def _lowInPeriod1 = Lowest(low, LookbackPeriod);
#--------------------------------------------------------------
def marketLow1 = if _lowInPeriod1 < _lowInPeriod1[-LookbackPeriod] then _lowInPeriod1 else _lowInPeriod1[-LookbackPeriod];
def _markedLow1 = low == marketLow1;

rec _lastMarkedLow1 = CompoundValue(1, if IsNaN(_markedLow1) then _lastMarkedLow1[1] else if _markedLow1 then low else _lastMarkedLow1[1], low);
#--------------------------------------------------------------
def marketHigh1 = if _highInPeriod1 > _highInPeriod1[-LookbackPeriod] then _highInPeriod1 else _highInPeriod1[-LookbackPeriod];
def _markedHigh1 = high == marketHigh1;

rec _lastMarkedHigh1 = CompoundValue(1, if IsNaN(_markedHigh1) then _lastMarkedHigh1[1] else if _markedHigh1 then high else _lastMarkedHigh1[1], high);
#--------------------------------------------------------------
def Resistance1 = _lastMarkedHigh1;
def Support1 = _lastMarkedLow1;

#--------------------------------------------------------------
def LowSwingForw = Lowest(low, SwingsLagBar)[-SwingsLagBar];
def LowSwingBack = Lowest(low, LookbackPeriod)[1];
def SwingLow = if low < LowSwingForw and low <= LowSwingBack then 1 else 0;
def LowSwing = if SwingLow then low else Double.NaN;

#--------------------------------------------------------------
def HighSwingForw = Highest(high, SwingsLagBar)[-SwingsLagBar];
def HighSwingBack = Highest(high, LookbackPeriod)[1];
def SwingHigh = if high > HighSwingForw and high >= HighSwingBack then 1 else 0;
def HighSwing = if SwingHigh then high else Double.NaN;


#--------------------------------------------------------------
def _highInPeriod2 = Highest(high(period = TimeFrame2), LookbackPeriod);
def _lowInPeriod2 = Lowest(low(period = TimeFrame2), LookbackPeriod);
#--------------------------------------------------------------
def marketLow2 = if _lowInPeriod2 < _lowInPeriod2[-LookbackPeriod] then _lowInPeriod2 else _lowInPeriod2[-LookbackPeriod];
def _markedLow2 = low(period = TimeFrame2) == marketLow2;

rec _lastMarkedLow2 = CompoundValue(1, if IsNaN(_markedLow2) then _lastMarkedLow2[1] else if _markedLow2 then low(period = TimeFrame2) else _lastMarkedLow2[1], low(period = TimeFrame2));
#--------------------------------------------------------------
def marketHigh2 = if _highInPeriod2 > _highInPeriod2[-LookbackPeriod] then _highInPeriod2 else _highInPeriod2[-LookbackPeriod];
def _markedHigh2 = high(period = TimeFrame2) == marketHigh2;

rec _lastMarkedHigh2 = CompoundValue(1, if IsNaN(_markedHigh2) then _lastMarkedHigh2[1] else if _markedHigh2 then high(period = TimeFrame2) else _lastMarkedHigh2[1], high(period = TimeFrame2));
#--------------------------------------------------------------
def Resistance2 = _lastMarkedHigh2;

def Support2 = _lastMarkedLow2;

#--------------------------------------------------------------
def _highInPeriod3 = Highest(high(period = TimeFrame3), LookbackPeriod);
def _lowInPeriod3 = Lowest(low(period = TimeFrame3), LookbackPeriod);
#--------------------------------------------------------------
def marketLow3 = if _lowInPeriod3 < _lowInPeriod3[-LookbackPeriod] then _lowInPeriod3 else _lowInPeriod3[-LookbackPeriod];
def _markedLow3 = low(period = TimeFrame3) == marketLow3;

rec _lastMarkedLow3 = CompoundValue(1, if IsNaN(_markedLow3) then _lastMarkedLow3[1] else if _markedLow3 then low(period = TimeFrame3) else _lastMarkedLow3[1], low(period = TimeFrame3));
#--------------------------------------------------------------
def marketHigh3 = if _highInPeriod3 > _highInPeriod3[-LookbackPeriod] then _highInPeriod3 else _highInPeriod3[-LookbackPeriod];
def _markedHigh3 = high(period = TimeFrame3) == marketHigh3;

rec _lastMarkedHigh3 = CompoundValue(1, if IsNaN(_markedHigh3) then _lastMarkedHigh3[1] else if _markedHigh3 then high(period = TimeFrame3) else _lastMarkedHigh3[1], high(period = TimeFrame3));
#--------------------------------------------------------------
def Resistance3 = _lastMarkedHigh3;

def Support3 = _lastMarkedLow3;


def lower_close1 = (SMA crosses below Support1[1]);
def higher_close1 = (SMA crosses above Resistance1[1]);
def lower_close2 = (SMA crosses below Support2[1]);
def higher_close2 = (SMA crosses above Resistance2[1]);
def lower_close3 = (SMA crosses below Support2[1]);
def higher_close3 = (SMA crosses above Resistance2[1]);

def x = (hl2 > xx);
def c = (close[1] < xx[1]);
def v = (close[2] < xx[2]);
def b = x and (c or v);

def y = (close > bb);
def w = (close[1] < bb[1]);
def e = (close[2] < bb[2]);
def r = y and (w or e);

def allbreakdown = lower_close1 or lower_close2 or lower_close3;
def allbreakup =  (higher_close1 or higher_close2 or higher_close3);

input BuyEntry2 = 40;
input SellEntry2 = 40;

def QB2 = Highest(high, BuyEntry2);
def QS2 = Lowest(low, SellEntry2);
def trueqb2 = QB2[1];

def trueqs2 = QS2[1];

def ath = (((trueqb2 - trueqb2[10]) / 100) < .10);
def atl = (((trueqs2 - trueqs2[10]) / 100) >= -.10);

def length4 = 10;
def displace2 = 0;
def AvgExp = ExpAverage(price[-displace2], length4);


def midline = (QS[1] + QB[1]) / 2;

def badhammer = (((high - close) < ((close + open) / 2) - low)) and (open > QB[1]);


def comboupstrongstrongstrong = (high > QB[1]) and (c[1] < QB[2]) and (((high - QB[1]) / 100) < outo) and (((QB[1] - Avgexp) / 100) < conso) and (low < midline[1]);

def comboupstrongstrong = (high > QB[1]) and (c[1] < QB[2]) and (((open - QB[1]) / 100) < outo) and (((QB[1] - Avgexp) / 100) < conso) and (open[1] or open[2] or open[3] < midline) and comboupstrongstrongstrong is false and (open < QB[1]) and (open[1] > QS[2]) and (close[1] < midline[2]);

def comboupstrong = (high > QB[1]) and (close[1] < QB[2]) and (((open - QB[1]) / 100) < outo) and (((QB[1] - Avgexp) / 100) < conso)  and comboupstrongstrongstrong is false and comboupstrongstrong is false and (high > open) and (low < midline) and (high > open);

def any = comboupstrong or comboupstrongstrong or comboupstrongstrongstrong;

def goldenbuy = ((allbreakup or allbreakup[1]));
def krg = (er > ave);
def krgd = (er < ave);

plot buy = goldenbuy and (goldenbuy[1] is false) and (close > open) and krg and trending;


def goldenshort = (allbreakdown or allbreakdown[1]);

#plot sell = goldenshort and (goldenshort[1] is false) and (close < open) and krgd and trending;
 
Mine gets squished with the new one for some reason...daily chart is too small to read...anything less than that is just a flat jumbled line for some reason...I know it has to be on my end or others would be having the issue...here is a 1hr Old one....then the new one...the bottom drawing on the new version down by the ER and Dividend icons is what seems to be taking up the real-estate



Old version: https://tos.mx/T5VRk7Q

New version: https://tos.mx/zS2n3JP


as stated...Daily isn't as bad but still too small to see clearly...

Daily: https://tos.mx/Bucm9rN
 
Mine gets squished with the new one for some reason...daily chart is too small to read...anything less than that is just a flat jumbled line for some reason...I know it has to be on my end or others would be having the issue...here is a 1hr Old one....then the new one...the bottom drawing on the new version down by the ER and Dividend icons is what seems to be taking up the real-estate



Old version: https://tos.mx/T5VRk7Q

New version: https://tos.mx/zS2n3JP
I have the same problem
 
Status
Not open for further replies.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
256 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top