NexusFi: Find Your Edge


Home Menu

 





SMA on different time frames


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one mtzimmer1 with 1 posts (0 thanks)
    2. looks_two tebteb36 with 1 posts (0 thanks)
    3. looks_3 fcg1 with 1 posts (0 thanks)
    4. looks_4 Latitude with 1 posts (1 thanks)
    1. trending_up 1,503 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
Latitude
Edmonton Alberta, Canada
 
Posts: 1 since Dec 2019
Thanks Given: 0
Thanks Received: 1

Hello everyone,

Looking to see if there's an easy answer for this. I'm looking to differentiate moving averages based on times frames.
For example, on my daily chart I want the 20,50,200 Simple Moving Average(SMA) and on the weekly and monthly I want a 10 SMA. The problem is when I add a study it's applied to all times frames. Is there a way to separate it?


Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
 
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)
 
mtzimmer1's Avatar
 mtzimmer1 
Upstate NY
Recovering Method Hopper
 
Experience: Intermediate
Platform: TOS
Broker: TD Ameritrade
Trading: Equities, Treasuries, Gold
Posts: 840 since Dec 2018
Thanks Given: 2,201
Thanks Received: 1,918

As far as I am aware there is not a way to achieve this.

One alternative is to have two charts open on flexible charts, each with separate studies.


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 fcg1 
Alma, WI
 
Experience: Advanced
Platform: Sierra Chart, TOS
Trading: NQ, ES, ZB, CL
Posts: 2 since Mar 2019
Thanks Given: 0
Thanks Received: 0


(quirk: sometimes I saw the sma1 value in the data box, not the chart for say Weekly until something changed on the chart and it recalc'd) but try:

input sma_len_1 = 10;
input sma_len_2 = 20;
input sma_len_3 = 50;
input sma_len_4 = 200;

def agg = GetAggregationPeriod();

plot sma1 = MovingAverage(AverageType.SIMPLE, close, sma_len_1);
sma1.SetHiding (Agg > AggregationPeriod.DAY or Agg < AggregationPeriod.DAY);
plot sma2 = MovingAverage(AverageType.Simple,Close,sma_len_2);
sma2.SetHiding (Agg < AggregationPeriod.Week);
plot sma3 = MovingAverage(AverageType.SIMPLE, close, sma_len_3);
sma3.SetHiding (Agg < AggregationPeriod.Week);
plot sma4 = MovingAverage(AverageType.SIMPLE, close, sma_len_4);
sma4.SetHiding (Agg < AggregationPeriod.Week);


Reply With Quote




Last Updated on December 11, 2019


© 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