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,027 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

SMA on different time frames

  #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?
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
26 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
21 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 Twitter 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts