NexusFi: Find Your Edge


Home Menu

 





alert for 20 day sma moving above 200 day sma


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one ColoradoCliff with 1 posts (1 thanks)
    2. looks_two coolcat7fl with 1 posts (0 thanks)
    3. looks_3 swamijenkins with 1 posts (0 thanks)
    4. looks_4 Python Programmer with 1 posts (0 thanks)
    1. trending_up 3,207 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 2 attachments




 
Search this Thread
  #1 (permalink)
coolcat7fl
sarasota, fl
 
Posts: 1 since Nov 2020
Thanks Given: 0
Thanks Received: 0

can someone help me create a script for an alert when the 20day sma moves above the 200 day sma? this would be i guess a scan for all stocks, or could i do it both ways, for a watchlist and for a scan?

cheers


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CME Launches Bitcoin Volatility Futures June 1 -- First …
Cryptocurrency
Thanks Mike. Godspeed.
The Elite Circle
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
Probability Collapse: Bitcoin $150k Craters from 15% to …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
ColoradoCliff
Parker CO/USA
 
Posts: 22 since Jun 2017
Thanks Given: 0
Thanks Received: 5


coolcat7fl View Post
can someone help me create a script for an alert when the 20day sma moves above the 200 day sma? this would be i guess a scan for all stocks, or could i do it both ways, for a watchlist and for a scan?

cheers

This is a "simple" use of the crossover study on scans. Note that this will only show you the stocks when the cross has just happened.

I'm not yet allowed to post links, so what you need to do is go to the Scan tool & select STUDY --> Crossover --> MovingAvgCrossover. Then change the short to 20 and the Long to 200. Select Simple for each MA and be sure you're using Daily. That's it!


Attached Thumbnails
Click image for larger version

Name:	image_796.png
Views:	331
Size:	59.1 KB
ID:	306710  
Attached Images
 
Reply With Quote
Thanked by:
  #3 (permalink)
 swamijenkins 
Lapeer, MI/USA
 
Experience: Advanced
Platform: ThinkorSwim
Trading: Emini ES, SPY Options
Posts: 1 since Sep 2016
Thanks Given: 1
Thanks Received: 0


This should work. If today's 20day is greater than today's 200day and yesterday's 20day is less than yesterday's 200day:

def fast = 20;
def slow = 200;

def FastSMA = MovingAverage(AverageType.Simple, close, fast);
def SlowSMA = MovingAverage(AverageType.Simple, close, slow);

plot BullMA = (FastSMA > SlowSMA) and (FastSMA[1] < SlowSMA[1]);


Reply With Quote
  #4 (permalink)
Python Programmer
Santa Barbara CA/USA
 
Posts: 1 since Aug 2020
Thanks Given: 0
Thanks Received: 0


coolcat7fl View Post
can someone help me create a script for an alert when the 20day sma moves above the 200 day sma? this would be i guess a scan for all stocks, or could i do it both ways, for a watchlist and for a scan?

cheers

Would a Python solution work for you? Recently I wrote a Python script that scans thousands of stocks in order to filter out stocks that meet a certain condition.


Reply With Quote




Last Updated on November 24, 2020


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts