High low band MTF

kc5560

New member
hello
can I have the High low band in multi time frame , (15 min, 5 min, 1 min)
This is SMA 20

def Period = AggregationPeriod.DAY;
def varhigh = high(period = Period);
def varlow = low(period = Period);

plot SMAH = SimpleMovingAvg(varhigh,20);
SMAH.AssignValueColor(Color.Green);
plot SMAL = SimpleMovingAvg(varlow,20);
SMAL.AssignValueColor(Color.Red);
 
Solution
hello
can I have the High low band in multi time frame , (15 min, 5 min, 1 min)
This is SMA 20

def Period = AggregationPeriod.DAY;
def varhigh = high(period = Period);
def varlow = low(period = Period);

plot SMAH = SimpleMovingAvg(varhigh,20);
SMAH.AssignValueColor(Color.Green);
plot SMAL = SimpleMovingAvg(varlow,20);
SMAL.AssignValueColor(Color.Red);

You can change your def period to input period and add it multiple times as a study and change the input to the timeframes you want.

Or, you can use the script function as in the following code to create one study with varying timeframes.

Remember that the chart timeframe must be equal to or greater than the lowest timeframe in your code for the code to display on your chart...
hello
can I have the High low band in multi time frame , (15 min, 5 min, 1 min)
This is SMA 20

def Period = AggregationPeriod.DAY;
def varhigh = high(period = Period);
def varlow = low(period = Period);

plot SMAH = SimpleMovingAvg(varhigh,20);
SMAH.AssignValueColor(Color.Green);
plot SMAL = SimpleMovingAvg(varlow,20);
SMAL.AssignValueColor(Color.Red);

You can change your def period to input period and add it multiple times as a study and change the input to the timeframes you want.

Or, you can use the script function as in the following code to create one study with varying timeframes.

Remember that the chart timeframe must be equal to or greater than the lowest timeframe in your code for the code to display on your chart.

Capture.jpg
Ruby:
script sma {
    input period = AggregationPeriod.DAY;

    def varhigh = high(period = period);
    def varlow = low(period = period);

    plot SMAH = SimpleMovingAvg(varhigh, 20);
    SMAH.AssignValueColor(Color.GREEN);
    plot SMAL = SimpleMovingAvg(varlow, 20);
    SMAL.AssignValueColor(Color.RED);
}
DefineGlobalColor("H", Color.GREEN);
DefineGlobalColor("L", Color.RED);

plot sma1h = sma(period = "MIN");
plot sma1l = sma(period = "MIN").SMAL;

plot sma5h = sma(period = "FIVE_MIN");
plot sma5l = sma(period = "FIVE_MIN").SMAL;

plot sma15h = sma(period = "FIFTEEN_MIN");
plot sma15l = sma(period = "FIFTEEN_MIN").SMAL;

sma1h.SetDefaultColor(GlobalColor("H"));
sma1l.SetDefaultColor(GlobalColor("L"));

sma5h.SetDefaultColor(GlobalColor("H"));
sma5l.SetDefaultColor(GlobalColor("L"));

sma15h.SetDefaultColor(GlobalColor("H"));
sma15l.SetDefaultColor(GlobalColor("L"));

input showbubbles = yes;
input bubblemover = 3;
def bm = bubblemover;
def bm1 = bm + 1;

AddChartBubble(showbubbles and IsNaN(close[bm]) and !IsNaN(close[bm1]), sma1h[bm1], "1m", GlobalColor("H"));
AddChartBubble(showbubbles and IsNaN(close[bm]) and !IsNaN(close[bm1]), sma1l[bm1], "1m", GlobalColor("L"));

AddChartBubble(showbubbles and IsNaN(close[bm]) and !IsNaN(close[bm1]), sma5h[bm1], "5m", GlobalColor("H"));
AddChartBubble(showbubbles and IsNaN(close[bm]) and !IsNaN(close[bm1]), sma5l[bm1], "5m", GlobalColor("L"));

AddChartBubble(showbubbles and IsNaN(close[bm]) and !IsNaN(close[bm1]), sma15h[bm1], "15m", GlobalColor("H"));
AddChartBubble(showbubbles and IsNaN(close[bm]) and !IsNaN(close[bm1]), sma15l[bm1], "15m", GlobalColor("L"));
 
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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