Script to add a moving average - futures io
futures io

Script to add a moving average

Discussion in ThinkOrSwim

    1. trending_up 73 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments

Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Search this Thread

Script to add a moving average

(login for full post details)
  #1 (permalink)
Miami Florida US
Posts: 16 since Oct 2015
Thanks: 5 given, 1 received

Can someone please show me how to add a 50 bar simple moving average to the following relative strength script that is found in TOS:

declare lower;

input CorrelationWithSecurity = "SPX";
def close2 = close(CorrelationWithSecurity);

plot RS = if close2 == 0 then 0 else close/close2;

def sr = CompoundValue("historical data" = RS, "visible data" = if isNaN(sr[1]) then RS else sr[1]);
plot SRatio = sr;

Reply With Quote

futures io Trading Community Platforms and Indicators ThinkOrSwim > Script to add a moving average

Last Updated on July 19, 2021

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


A Transparent Glimpse Into a Prop Traders Life w/Chris Gray @ Earn2Trade

Elite only

Our 12-year anniversary w/ $$,$$$ prizes (check soon)


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, 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.
no new posts