YungTrader's Ultimate Indicator

Status
Not open for further replies.
Did the scan from #304 return CRM for you? If not, which scan are you using?
#304

Not sure which version.

This is for short, you can swap bottom 2 lines for long.

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);

# Signals
#plot goldenbuy = (allbreakup or  allbreakup[1]) and ((high) > trueqb2) and ath;
plot goldenshort = (allbreakdown or  allbreakdown[1]) and ((low) < trueqs2) and atl;
 
Did you get in any of those tickers you called out yesterday? My best guess is a 1.5% market gap up followed by a dump of some of the market gains at open. You may not get ideal entries if you didn't already pick up some shares.
No, I was thinking I will get in this morning but they all gapped up. I might have to change how I execute the trades.
 
Yes. I guess we need to have enough short trades or hedge as well.
I do options. overnight swings 50/50 so its risky. I rather scan right after the bell and get in. if we have better strategy Ill take that :)
EDIT: I scan right after the bell and got signals and went for TGT and it turned out beautiful. Calls up %200
 
Last edited:
I do options. overnight swings 50/50 so its risky. I rather scan right after the bell and get in. if we have better strategy Ill take that :)
EDIT: I scan right after the bell and got signals and went for TGT and it turned out beautiful. Calls up %200

What would you do if it gaps up? Would you still get into the trade? I do options as well. For CRM I sold PUT 30 mins after the bell.
 
What would you do if it gaps up? Would you still get into the trade? I do options as well. For CRM I sold PUT 30 mins after the bell.
I dont feel safe with selling puts somehow. I use ATR and looking at momentum whats my possibility and predict how much stock can move on daily. (I apply regular ATR)
 
I dont feel safe with selling puts somehow. I use ATR and looking at momentum whats my possibility and predict how much stock can move on daily. (I apply regular ATR)

I will only sell PUTs in the stock which I don't mind holding if I get assigned. If I get assigned, I will do the Wheel strategy.
 
hi @YungTraderFromMontana , Thanks for sharing this script and Appreciate your sincere effort & guidance. Im new to tos scripting and a swing trader so Im looking for key signal indicators in a day/weekly chart and then move into 1H chart on next day to open the trades.
I've loaded your study and trying to learn and play around these key variables.
lookback period:
timeframe 2:
timeframe 3:
buy entry2:
sell entry2:

I have some basic questions -
1. is the lookback period the number of bars to the left? or is it default to days?
2. I tried playing around the timeframe2/3 setting to 2 intervals apart & 4 intervals apart, along with changing the lookback period to 2 & 4 respectively. Example: (2, 1hr, 2hr) or (4, 1day, 4days). And the signals look valid for most charts that I tried.
Can you please suggest if this is meaningful way to use these varaibles?
3. And can I set the buy/sell entry signals to just 1 or 2?
4. How to use the keratio indicator?
 
Last edited:
I will only sell PUTs in the stock which I don't mind holding if I get assigned. If I get assigned, I will do the Wheel strategy.
I have a indicator now shows gap fills. (if you would like to.. I can share it) ill scan right before market close and chart out if I see any gap needs to fill Ill buy calls or puts if no any signal ill scan right after market opens.
 
hi @YungTraderFromMontana , Thanks for sharing this script and Appreciate your sincere effort & guidance. Im new to tos scripting and a swing trader so Im looking for key signal indicators in a day/weekly chart and then move into 1H chart on next day to open the trades.
I've loaded your study and trying to learn and play around these key variables.
lookback period:
timeframe 2:
timeframe 3:
buy entry2:
sell entry2:

I have some basic questions -
1. is the lookback period the number of bars to the left? or is it default to days?
2. I tried playing around the timeframe2/3 setting to 2 intervals apart & 4 intervals apart, along with changing the lookback period to 2 & 4 respectively. Example: (2, 1hr, 2hr) or (4, 1day, 4days). And the signals look valid for most charts that I tried.
Can you please suggest if this is meaningful way to use these varaibles?
3. And can I set the buy/sell entry signals to just 1 or 2?
4. How to use the keratio indicator?
1. It's the number of bars it looksback to find a support or resistance.
2. Yes that's is meaningful
3. ?
4. Look back in time a look at the correlation between ker and price. Generally if Ke goes up then price goes up but it goes deeper. The best way is to see for yourself.
 
gy is very difficult around earnings season on higher aggregations. Once we're past it plays will be coming at us like crazy without earnings messing with us.
Roku and AAOI got smashed by earnings I think so there set ups got destroyed. The others I agree with just beware that some of them are running into resistances. (INTU 282 and BHC 15.5.). If you want another short to hedge out beta I'm still confident on co short. It should stay at worst stagnant on market up days and should fetch 3+ percent on down days.
Silly mistake on my part for not looking more closely at the premarket prices for ROKU and AAOI...

WDAY and AUY had a nice run up ~3%
Z went on a rampage 10%+

this strategy lets us know that an explosive moves is eminent and i feel in order to fully maximize on the opportunity we can use options. This will require a bit more invovement with the trade but can be very well worth it.

i reckon it would be better to take small positions (sells/buys) on these smaller cap stocks [shares]
then filter down the large caps to around two or three solid ones that you are sure will move (make sure there is sizzle and relative volume premarket) [important that these tickers have weekly contracts and they are not some random stock you never heard of] --- these tickers are going to be your intraday option plays.

Most of your capital can be deployed in these lower risk play on shares, but if you chose to you can parlay these gains into these option plays
(i personally will be using this strategy when i open up my acc with td since i just turned 18 and dont have access to lots of capital to buy shares and short shares with. this will be come in handy to build up my smoll acc so i can get into shares).
Unlike trading shares, you will need to put much more effort into perfecting your entries AND exits because if you just enter haphazardly then even if you end up being right on the move you can break even. So it is important to backtest this and use paper money to get the hang of it.

for example: today my option plays were Z, CRM, and TMUS (i only played shares on AUY and WDAY)
on 0dte atm contracts from Z went up 300% (51 strike)
crm went up 60% (technically 105% but i would have been out on the pullback)
tmus up 140% [this is the only option play i took out of the 3; tmus 95 calls, got in 1.12 and exited at 2.70]
*all these trades were done in tospapermoney, (still learning ;))

Like i said entries are vital to me since im trading options...
So far im keepin this barebones but will be open to adding other elements to help with my entries
I use the vix to gauge market direction
i also use the previous day close
and i use priceaction/ volume
i also use weekly volume profile levels along

lastly, i had a bullish market bias since vix was on a downtrend and had broken a super key level at ~30.5 and wicked on its retest
unknown.png

this was a good confirmation to look for long option plays. however tmus had a corilation of .53 so i wasnt that worried either way
I waited for the gap to fill on tmus and then i wanted to see buyer step
i liked the second bounce and decided to hop in


unknown.png

basically the plan is to get gud at this so i can flip 1k to ~25k so then i can start dip my toes into small cap shares and take multiple positions on at once
and yeah thats it, idunno hope this helped
 
@television What's your trendline study it looks clean? I agree that because successful breakouts incur gains in the stock that heavily outpace the expected move in the stock options could be the most valuable thing to use. Especcially those far out of the money that have a low itm chance. I may have to work out the math and come up with a quick formula on breakouts to find a good strike, probably including a variable of nearest resistance among other things
 
Status
Not open for further replies.

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
475 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