MTF Multi-Timeframe Aroon For ThinkOrSwim

Ian_Tai

New member
I was looking to add MTF to my Aroon indicator and found this thread. It's great.
https://usethinkscript.com/threads/converting-indicator-to-multi-timeframe-mtf-in-thinkorswim.8050/
But, I tried it and it does not work.

I'm on a Daily Chart and I wanted Aroon to plot for the Week. Here's what I got. any help will be appreciated:

declare lower;

input length = 25;
input agg = AggregationPeriod.Week;
def close = close(period = agg);

Assert(length > 0, "'length' must be positive: " + length);

plot Up = (length - 1 - GetMaxValueOffset(high, length)) * 100.0 / (length - 1);
plot Down = (length - 1 - GetMinValueOffset(low, length)) * 100.0 / (length - 1);
plot OverBought = 70;
plot OverSold = 30;

Up.SetDefaultColor(GetColor(1));
Down.SetDefaultColor(GetColor(5));
OverBought.SetDefaultColor(GetColor(8));
OverSold.SetDefaultColor(GetColor(8));

AddCloud(if Up > 90 and Down < 10 then Up else Double.NEGATIVE_INFINITY, if Up > 90 and Down < 10 then Down else Double.NEGATIVE_INFINITY, Color.CYAN);
AddCloud(if Up < 10 and Down > 90 then Down else Double.NEGATIVE_INFINITY, if Up < 10 and Down > 90 then Up else Double.NEGATIVE_INFINITY, Color.MAGENTA);
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I was looking to add MTF to my Aroon indicator and found this thread. It's great.
https://usethinkscript.com/threads/converting-indicator-to-multi-timeframe-mtf-in-thinkorswim.8050/
But, I tried it and it does not work.

I'm on a Daily Chart and I wanted Aroon to plot for the Week. Here's what I got. any help will be appreciated:

declare lower;

input length = 25;
input agg = AggregationPeriod.Week;
def close = close(period = agg);

Assert(length > 0, "'length' must be positive: " + length);

plot Up = (length - 1 - GetMaxValueOffset(high, length)) * 100.0 / (length - 1);
plot Down = (length - 1 - GetMinValueOffset(low, length)) * 100.0 / (length - 1);
plot OverBought = 70;
plot OverSold = 30;

Up.SetDefaultColor(GetColor(1));
Down.SetDefaultColor(GetColor(5));
OverBought.SetDefaultColor(GetColor(8));
OverSold.SetDefaultColor(GetColor(8));

AddCloud(if Up > 90 and Down < 10 then Up else Double.NEGATIVE_INFINITY, if Up > 90 and Down < 10 then Down else Double.NEGATIVE_INFINITY, Color.CYAN);
AddCloud(if Up < 10 and Down > 90 then Down else Double.NEGATIVE_INFINITY, if Up < 10 and Down > 90 then Up else Double.NEGATIVE_INFINITY, Color.MAGENTA);

Try adjusting the prices in Up and Down as you did for def close:

Code:
plot Up = (length - 1 - GetMaxValueOffset(high(period =  agg), length)) * 100.0 / (length - 1);
plot Down = (length - 1 - GetMinValueOffset(low(period = agg), length)) * 100.0 / (length - 1);
 
Hey guys im trying to apply a multi-timeframe setting to this indicator I made with no luck so far. It puts a dot above/below the current candle if the up/down differential on the Aroon Oscillator is above/below the input thresholds. So ideally this would give a dot from a 1 hour chart on your current 5min chart candle indicating a sell/buy signal from a higher timeframe. Ultimately i'd like to put a few of these on my 5min chart and get signals from 1hr,4hr, and daily Aroon Oscillators.

If anyone knows how to help I would really appreciate it

def na = Double.NaN;


input length = 25;
input period1 = AggregationPeriod.HOUR;
def range = high(period=period1) - low(period=period1);
def plotter = range * 0.3;

Input uThreshold=99;
input lThreshold = -99;

def aroonUp = reference AroonIndicator(length = length).Up;
def aroonDown = reference AroonIndicator(length = length).Down;

def UpDownDiff = aroonUp - aroonDown;

plot lowtick = if UpDownDiff <= lThreshold then low - plotter else na;
plot hightick = if UpDownDiff >= uThreshold then high + plotter else na;

lowtick.SetDefaultColor(Color.YELLOW);
lowtick.SetStyle(Curve.POINTS);
lowtick.SetLineWeight(4);
hightick.SetDefaultColor(Color.YELLOW);
hightick.SetStyle(Curve.POINTS);
hightick.SetLineWeight(4);
 
Here ya go:
Ruby:
def na = Double.NaN;

input length = 25;
input period1 = AggregationPeriod.HOUR;
def close = close(period = period1);
def high= high(period = period1);
def low= low(period = period1);

def range = high - low;
def plotter = range * 0.3;

Input uThreshold=99;
input lThreshold = -99;

def aroonUp = (length - 1 - GetMaxValueOffset(high, length)) * 100.0 / (length - 1);
def aroonDown = (length - 1 - GetMinValueOffset(low, length)) * 100.0 / (length - 1);

def UpDownDiff = aroonUp - aroonDown;

plot lowtick = if UpDownDiff <= lThreshold then low - plotter else na;
plot hightick = if UpDownDiff >= uThreshold then high + plotter else na;

lowtick.SetDefaultColor(Color.YELLOW);
lowtick.SetStyle(Curve.POINTS);
lowtick.SetLineWeight(4);
hightick.SetDefaultColor(Color.YELLOW);
hightick.SetStyle(Curve.POINTS);
hightick.SetLineWeight(4);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
333 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