YungTrader's Ultimate Indicator

  • Thread starter YungTraderFromMontana
  • Start date
YungTraderFromMontana

YungTraderFromMontana

Well-known member
@YungTraderFromMontana Thanks for your continuous efforts to improve this indicator.

Scan is the heart of this indicator. Hope you will find a way to improve it.

Does the old scan work along with your latest indicator?

You mentioned that "If it's a slow day and I'm not finding good plays I check 2-4. 3-4 is best imo on d and 2d though." Can you describe which value should be used for which parameter?

Just an observation, on most of the charts I saw ECI compression zone before breakout. It is nice to see two indicators agreeing
https://usethinkscript.com/threads/eci-gaussian-indicator-for-thinkorswim.1160/
When I was talking about "If it's a slow day...." I was referring to changing the lookback. It is like the first line of code in the scan, I'll just quickly cycle through numbers 2-4 if I'm not finding much on 3. The longer the lookback the more established the s/r. Usually this is good but it also sometimes mean you get in to late if its to high. That's why I think 3-4 is the best, 2 is okay, and 5+ is good for breakout to new highs or lows but that's about it.
 
P

pk1729

Member
VIP
When I was talking about "If it's a slow day...." I was referring to changing the lookback. It is like the first line of code in the scan, I'll just quickly cycle through numbers 2-4 if I'm not finding much on 3. The longer the lookback the more established the s/r. Usually this is good but it also sometimes mean you get in to late if its to high. That's why I think 3-4 is the best, 2 is okay, and 5+ is good for breakout to new highs or lows but that's about it.
Thanks for the explanation. Probably this was answered earlier, if yes, apologies in advance for asking again.

I can see that this indicator and scan works well on Daily. Can it be used on smaller time frames Hourly, 30mins? I am using one of the scans shared earlier and scan fails with message "Secondary period now allowed: DAY". Is this designed to work only on Daily? Following is the scan code I have -

Code:
input LookbackPeriod = 3;
input TimeFrame2 = "DAY";
input TimeFrame3 = "DAY";
input price = close;
input BuyEntry2 = 10;
input SellEntry2 = 10;

#input HideSwings = no;
#input HideCurrentTF = no;
#input HideTimeFrame2 = no;
#input HideTimeFrame3 = no;
#input length1 = 8;
#input length21 = 40;
#input length31 = 4;

#assert(length1 > 0, "'length' must be positive: " + length1);
#def ROC = if price[length1] != 0 then (price / price[length1] - 1) * 100 else 0;
#assert(length21 > 0, "'length' must be positive: " + length21);
#def ROC2 = if price[length21] != 0 then (price / price[length21] - 1) * 100 else 0;
#assert(length31 > 0, "'length' must be positive: " + length31);
#def ROC3 = if price[length21] != 0 then (price / price[length31] - 1) * 100 else 0;
#def xx = roc >= roc2 or roc2 > roc3;
#def yy = roc <= roc2 or roc2 < roc3;

#input BuyEntry3 = 10;
#input SellEntry3 = 10;
#def displace2 = 0;
#def QB3 = Highest(roc, BuyEntry3);
#def QS3 = Lowest(roc, SellEntry3);
#def trueqb3 = QB3[1];
#def trueqs3 = QS3[1];
#def SMaoftruedepth= Average(trueqb3-trueqs3[-displace2], length21);
#def squeeze = (trueqb3 - trueqs3) < (smaoftruedepth/2);
#def bottom = 10;
#def top = -10;
#def goodlong = squeeze or squeeze[1] or squeeze[2];
#def goodshort = roc < trueqb3 or (roc[1] < top);

#def SwingsLagBar = 1;
#def BuyEntry = 3;
#def SellEntry = 3;

#def QB = Highest(high, BuyEntry);
#def QS = Lowest(low, SellEntry);
#def trueqb = QB[1];
#def trueqs = QS[1];

def length = 1;
def displace = 0;
def SMA = Average(price[-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 Support3[1]);
def higher_close3 = (SMA crosses above Resistance3[1]);

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

#def y = (close > trueqs);
#def w = (close[1] < trueqs[1]);
#def e = (close[2] < trueqs[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);

def QB2 = Highest(high, BuyEntry2);
def QS2 = Lowest(low, SellEntry2);

def trueqb2 = QB2[1];
def trueqs2 = QS2[1];

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

plot goldenbuy = (allbreakup or  allbreakup[1]) and ((high) > trueqb2) and ath;
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
Thanks for the explanation. Probably this was answered earlier, if yes, apologies in advance for asking again.

I can see that this indicator and scan works well on Daily. Can it be used on smaller time frames Hourly, 30mins? I am using one of the scans shared earlier and scan fails with message "Secondary period now allowed: DAY". Is this designed to work only on Daily? Following is the scan code I have -

Code:
input LookbackPeriod = 3;
input TimeFrame2 = "DAY";
input TimeFrame3 = "DAY";
input price = close;
input BuyEntry2 = 10;
input SellEntry2 = 10;

#input HideSwings = no;
#input HideCurrentTF = no;
#input HideTimeFrame2 = no;
#input HideTimeFrame3 = no;
#input length1 = 8;
#input length21 = 40;
#input length31 = 4;

#assert(length1 > 0, "'length' must be positive: " + length1);
#def ROC = if price[length1] != 0 then (price / price[length1] - 1) * 100 else 0;
#assert(length21 > 0, "'length' must be positive: " + length21);
#def ROC2 = if price[length21] != 0 then (price / price[length21] - 1) * 100 else 0;
#assert(length31 > 0, "'length' must be positive: " + length31);
#def ROC3 = if price[length21] != 0 then (price / price[length31] - 1) * 100 else 0;
#def xx = roc >= roc2 or roc2 > roc3;
#def yy = roc <= roc2 or roc2 < roc3;

#input BuyEntry3 = 10;
#input SellEntry3 = 10;
#def displace2 = 0;
#def QB3 = Highest(roc, BuyEntry3);
#def QS3 = Lowest(roc, SellEntry3);
#def trueqb3 = QB3[1];
#def trueqs3 = QS3[1];
#def SMaoftruedepth= Average(trueqb3-trueqs3[-displace2], length21);
#def squeeze = (trueqb3 - trueqs3) < (smaoftruedepth/2);
#def bottom = 10;
#def top = -10;
#def goodlong = squeeze or squeeze[1] or squeeze[2];
#def goodshort = roc < trueqb3 or (roc[1] < top);

#def SwingsLagBar = 1;
#def BuyEntry = 3;
#def SellEntry = 3;

#def QB = Highest(high, BuyEntry);
#def QS = Lowest(low, SellEntry);
#def trueqb = QB[1];
#def trueqs = QS[1];

def length = 1;
def displace = 0;
def SMA = Average(price[-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 Support3[1]);
def higher_close3 = (SMA crosses above Resistance3[1]);

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

#def y = (close > trueqs);
#def w = (close[1] < trueqs[1]);
#def e = (close[2] < trueqs[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);

def QB2 = Highest(high, BuyEntry2);
def QS2 = Lowest(low, SellEntry2);

def trueqb2 = QB2[1];
def trueqs2 = QS2[1];

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

plot goldenbuy = (allbreakup or  allbreakup[1]) and ((high) > trueqb2) and ath;
See where it says "day" next to timeframe 2-3. Change that to the desired time like "30 minutes" for example. Make sure you call the right aggregation, if you say it slightly wrong like "30 minute" in won't work.
 
A

akykn

Member
Yes they are a lot better, if you want to compare you can use the new one and make a plot with the old conditions. Then you can see both the old and new signals. Just make sure you make one wedges and one arrows so they don't cover each other. Accuracy and quality should be improved.
You can share a scan by clicking on the same button you use to save scans and hit share instead. This will give you a link which is easy to share.
big THANK YOU :)
 
H

HighBredCloud

Well-known member
VIP
See where it says "day" next to timeframe 2-3. Change that to the desired time like "30 minutes" for example. Make sure you call the right aggregation, if you say it slightly wrong like "30 minute" in won't work.
For folks not familiar with how the format works: 30 minutes would be written as THIRTY_MIN
1 hour would be written as: HOUR
2 hours would be written as: TWO_HOURS

Do this first to avoid posts stating that the scanner does not work...
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
Market looks unpredictable so my calls doesnt look promising at the moment. Im still seeing the market bullish. Maybe later today who knows
My tip is to make sure the market movement can't have an effect on your gains. Evenly spread out long and short positions. Enter more longs on up days and more short on up days. For example the market has been very ranged recently. Accumulate longs below 282 and accumulate shorts above 285. Don't be reactionary be proactive.
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
Are there any more unique momentum indicators that people suggest testing? I feel the volatility portion of this is nailed but the momentum gaugin aspect could be improved. All suggestions are appreciated.
 
H

HighBredCloud

Well-known member
VIP
Are there any more unique momentum indicators that people suggest testing? I feel the volatility portion of this is nailed but the momentum gaugin aspect could be improved. All suggestions are appreciated.
I too would like to know of a good momentum...but other than Relative Volume I don't know of anything else that might be helpful to be honest. You can try something like Trade Ideas has where % Change is given with in a certain timeframe...that too can be a good indication of momentum and hopefully you can figure out how to implement Relative Volume into this equation.
 
A

akykn

Member
My tip is to make sure the market movement can't have an effect on your gains. Evenly spread out long and short positions. Enter more longs on up days and more short on up days. For example the market has been very ranged recently. Accumulate longs below 282 and accumulate shorts above 285. Don't be reactionary be proactive.
do you get in short signals or only calls singals? I usually get in both signals but stop out with small loss if my positions goes againts me. Also looking at spy in premarket can give you heads up imo !!!
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
I too would like to know of a good momentum...but other than Relative Volume I don't know of anything else that might be helpful to be honest. You can try something like Trade Ideas has where % Change is given with in a certain timeframe...that too can be a good indication of momentum and hopefully you can figure out how to implement Relative Volume into this equation.
I've looked into relevant volume and it works some of the time but other times the volume comes in on the second day of the breakout making you miss the gains of the first day and gap to second. I could maybe implement it as a way to assist the arrows with some kind of dot or wedge when there high rel vol.
 
H

HighBredCloud

Well-known member
VIP
I've looked into relevant volume and it works some of the time but other times the volume comes in on the second day of the breakout making you miss the gains of the first day and gap to second. I could maybe implement it as a way to assist the arrows with some kind of dot or wedge when there high rel vol.
Try implementing this into your strategy...You will NOT miss the first or second day breakouts as you mentioned.

https://usethinkscript.com/threads/simple-yet-very-powerful-swing-trading-strategy.272/
 
C

Craighaber71

Active member
2019 Donor
VIP
Hi Craighaber71
Can you please tell me where can i find those 2 indicators on your chart? RSI_LAG and Momentum_Belt? i have tried to search the website but could not find them. Any help would be much appreciated!
RSI....https://tos.mx/mNXeU8c

MOMO belt is...StochasticMomentumIndex with a 6...15 setting
 
P

PirateTrader

New member
RSI....https://tos.mx/mNXeU8c

MOMO belt is...StochasticMomentumIndex with a 6...15 setting
Thank you so much appreciate that! do you happen to know if i can set the RSI to show signals from the 5m timeframe for example why i am looking at the 1m chart? or would i need to use 2 charts for that?
 
C

Craighaber71

Active member
2019 Donor
VIP
Thank you so much appreciate that! do you happen to know if i can set the RSI to show signals from the 5m timeframe for example why i am looking at the 1m chart? or would i need to use 2 charts for that?
It will only show the chart that you are on...
 

Similar threads

Top