Bullish Morning Momentum

Scotty123

New member
VIP
Hi All,

There is a filter on Fidelity's Active Trader Pro called "Bullish Morning Momentum" which:

[B]Finds stocks that opened today within 1% of today's low and current price is higher than the previous trading session's high.[/B]

It can often find stocks that have a nice upwardly sloping price line for the morning hours.

Would anyone know how to write the TOS script to create that indicator?

Thanks Much!

Scott
 
Solution
Hi All,

There is a filter on Fidelity's Active Trader Pro called "Bullish Morning Momentum" which:

[B]Finds stocks that opened today within 1% of today's low and current price is higher than the previous trading session's high.[/B]

It can often find stocks that have a nice upwardly sloping price line for the morning hours.

Would anyone know how to write the TOS script to create that indicator?

Thanks Much!

Scott

here is an upper chart study to experiment with
it displays the % change of day open and the day low
draws lines at day low and prev day high

if day low is within x% of day open and close is > prev day high, then high line is green

Code:
#bullish_morning_momentum...
Hi All,

There is a filter on Fidelity's Active Trader Pro called "Bullish Morning Momentum" which:

[B]Finds stocks that opened today within 1% of today's low and current price is higher than the previous trading session's high.[/B]

It can often find stocks that have a nice upwardly sloping price line for the morning hours.

Would anyone know how to write the TOS script to create that indicator?

Thanks Much!

Scott

here is an upper chart study to experiment with
it displays the % change of day open and the day low
draws lines at day low and prev day high

if day low is within x% of day open and close is > prev day high, then high line is green

Code:
#bullish_morning_momentum

#https://usethinkscript.com/threads/bullish-morning-momentum.21336/
#Bullish Morning Momentum

def na = double.nan;
def bn = barnumber();

def gd = GetDay();
def newday = gd != gd[1];
def n = 500;
def big = 99999;

def daylo;
def dayhi;
def prevhi;
if newday then {
 dayhi = fold a = 0 to n
 with b
 while getvalue(gd, -a) == gd
 do max(getvalue(high, -a), b);

 daylo = fold c = 0 to n
 with d = big
 while getvalue(gd, -c) == gd
 do min(getvalue(low, -c), d);

 prevhi = dayhi[1];
} else {
 dayhi = dayhi[1];
 daylo = daylo[1];
 prevhi = prevhi[1];
}

def dayopen = if newday then open else dayopen[1];
input open_low_per = 1.0;
def openlowper = round(100*(dayopen - daylo)/dayopen,1);
def isopenlowper = openlowper <= open_low_per;

def isclsprevhi = close >= prevhi;


#if low is within x% of open then make low line green
plot z1 = if isnan(prevhi) then na else if prevhi == 0 then na else prevhi;
z1.AssignValueColor(if isopenlowper and isclsprevhi then color.green else color.dark_gray);
z1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
z1.setlineweight(2);
z1.hidebubble();

plot z2 = daylo;
z2.SetDefaultColor(Color.gray);
z2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
z2.setlineweight(1);
z2.hidebubble();


addchartbubble(newday, daylo,
 openlowper + " %\n"
# dayopen + "\n" +
# daylo
, (if isopenlowper then color.green else color.gray), no);
#
 

Attachments

  • img1.JPG
    img1.JPG
    59.9 KB · Views: 89
Solution
here is an upper chart study to experiment with
it displays the % change of day open and the day low
draws lines at day low and prev day high

if day low is within x% of day open and close is > prev day high, then high line is green

Code:
#bullish_morning_momentum

#https://usethinkscript.com/threads/bullish-morning-momentum.21336/
#Bullish Morning Momentum

def na = double.nan;
def bn = barnumber();

def gd = GetDay();
def newday = gd != gd[1];
def n = 500;
def big = 99999;

def daylo;
def dayhi;
def prevhi;
if newday then {
 dayhi = fold a = 0 to n
 with b
 while getvalue(gd, -a) == gd
 do max(getvalue(high, -a), b);

 daylo = fold c = 0 to n
 with d = big
 while getvalue(gd, -c) == gd
 do min(getvalue(low, -c), d);

 prevhi = dayhi[1];
} else {
 dayhi = dayhi[1];
 daylo = daylo[1];
 prevhi = prevhi[1];
}

def dayopen = if newday then open else dayopen[1];
input open_low_per = 1.0;
def openlowper = round(100*(dayopen - daylo)/dayopen,1);
def isopenlowper = openlowper <= open_low_per;

def isclsprevhi = close >= prevhi;


#if low is within x% of open then make low line green
plot z1 = if isnan(prevhi) then na else if prevhi == 0 then na else prevhi;
z1.AssignValueColor(if isopenlowper and isclsprevhi then color.green else color.dark_gray);
z1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
z1.setlineweight(2);
z1.hidebubble();

plot z2 = daylo;
z2.SetDefaultColor(Color.gray);
z2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
z2.setlineweight(1);
z2.hidebubble();


addchartbubble(newday, daylo,
 openlowper + " %\n"
# dayopen + "\n" +
# daylo
, (if isopenlowper then color.green else color. Gray), no);
#
Wow, thank you very much!

Looking at that code, I can see why you are classified as an Expert with TOS script! And also a kitty lover from your picture!

I could almost say the script is perrrfect, except I want a scan filter so that I can find all the stocks that have bullish morning momentum. But it is an excellent start (that would probably take me years to come up with) and I will see what I can do!

Scotty123
 

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
500 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