MTF MA Cross Dashboard

lovetoloughlouder

New member
VIP
Hello Friends I am trying to create a lower indicator that can show me stacked rows of multi timeframe below is the code I tried but instead of coming as a row they are getting stacked on top of each other can any one help please. Appreciate your time and effort

This looks perfect for the 3 and 15 min rows, but when I added the 1 hour and 4 hour ones nothing is visible

plot hour4 = if IsNaN(close) then double.NaN else 1;
hour4.setPaintingStrategy(PaintingStrategy.POINTS);
hour4.setlineweight(5);
hour4.AssignValueColor(if LInEMA4Hour > VMA4hour then color.green else color.Magenta);
hour4.HideBubble() ;
hour4.HideTitle() ;

plot hour1 = if IsNaN(close) then double.NaN else 2;
hour1.setPaintingStrategy(PaintingStrategy.POINTS);
hour1.setlineweight(5);
hour1.AssignValueColor(if LInEMA1Hour > VMA1hour then color.green else color.red);
hour1.HideBubble() ;
hour1.HideTitle() ;


plot Min15X = if IsNaN(close) then double.NaN else 3;
Min15X.setPaintingStrategy(PaintingStrategy.POINTS);
Min15x.setlineweight(5);
Min15X.AssignValueColor(if LInEMA15Min > VMA15Min then color.green else color.red);
Min15X.HideBubble() ;
Min15X.HideTitle() ;

plot Min3X = if IsNaN(close) then double.NaN else 4;
Min3X.setPaintingStrategy(PaintingStrategy.POINTS);
Min3x.setlineweight(5);
Min3X.AssignValueColor(if LInEMA3Min > VMA3Min then color.green else color.red);
Min3X.HideBubble() ;
Min3X.HideTitle() ;
 

Attachments

  • Screenshot 2024-06-16 at 1.19.55 AM.png
    Screenshot 2024-06-16 at 1.19.55 AM.png
    10 KB · Views: 95
Last edited by a moderator:
Solution
@lovetoloughlouder
The awesome @SleepyZ is correct.
Your script has aggregation syntax issues.

Below is the script that you requested.
But it is not going to provide any significant or helpful analysis.
Your timeframes do not lend themselves to dashboards.
On a 3-min chart, the 4-hour line is going to repaint every tick for 80 of those dots until the 4-hr bar closes, at which point, it will do a final repaint of those 80 bars.


Best practices recommend that moving averages be analyzed with different lengths.
Short lengths are best to review immediate, short-term movements.
Longer lengths will provide analysis of long-term movements.

WLyhi47.png



Ruby:
##...
This looks perfect for the 3 and 15 min rows, but when I added the 1 hour and 4 hour ones nothing is visible I just copied your code and updated the constant number like this below

plot hour4 = if IsNaN(close) then double.NaN else 1;
hour4.setPaintingStrategy(PaintingStrategy.POINTS);
hour4.setlineweight(5);
hour4.AssignValueColor(if LInEMA4Hour > VMA4hour then color.green else color.Magenta);
hour4.HideBubble() ;
hour4.HideTitle() ;

plot hour1 = if IsNaN(close) then double.NaN else 2;
hour1.setPaintingStrategy(PaintingStrategy.POINTS);
hour1.setlineweight(5);
hour1.AssignValueColor(if LInEMA1Hour > VMA1hour then color.green else color.red);
hour1.HideBubble() ;
hour1.HideTitle() ;


plot Min15X = if IsNaN(close) then double.NaN else 3;
Min15X.setPaintingStrategy(PaintingStrategy.POINTS);
Min15x.setlineweight(5);
Min15X.AssignValueColor(if LInEMA15Min > VMA15Min then color.green else color.red);
Min15X.HideBubble() ;
Min15X.HideTitle() ;

plot Min3X = if IsNaN(close) then double.NaN else 4;
Min3X.setPaintingStrategy(PaintingStrategy.POINTS);
Min3x.setlineweight(5);
Min3X.AssignValueColor(if LInEMA3Min > VMA3Min then color.green else color.red);
Min3X.HideBubble() ;
Min3X.HideTitle() ;


The syntax for "4 Hour" should be changed to "4 Hours".
Click the icon in the upper left corner of the chart for help with errors
Screenshot 2024-06-17 130954.jpg
 
Last edited by a moderator:

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

@lovetoloughlouder
The awesome @SleepyZ is correct.
Your script has aggregation syntax issues.

Below is the script that you requested.
But it is not going to provide any significant or helpful analysis.
Your timeframes do not lend themselves to dashboards.
On a 3-min chart, the 4-hour line is going to repaint every tick for 80 of those dots until the 4-hr bar closes, at which point, it will do a final repaint of those 80 bars.


Best practices recommend that moving averages be analyzed with different lengths.
Short lengths are best to review immediate, short-term movements.
Longer lengths will provide analysis of long-term movements.

WLyhi47.png



Ruby:
## #######################################################
# Definitions
# define the conditions for painting your dashboard
## #######################################################
input price = hlc3;
input VMAlength = 13;
input LinLength = 34;

def VMA4hour = VariableMA(hlc3(period = AggregationPeriod.FOUR_HOURS), VMAlength);
def VMA1hour = VariableMA(hlc3(period = AggregationPeriod.HOUR), VMAlength);
def VMA15Min = VariableMA(hlc3(period = AggregationPeriod.FIFTEEN_MIN), VMAlength);
def VMA3Min = VariableMA(hlc3(period = AggregationPeriod.THREE_MIN), VMAlength);


def LInEMA4Hour = LinearRegAdjEMA(hlc3(period = AggregationPeriod.FOUR_HOURS), 34, 34, 34, 3);
def LInEMA1Hour = LinearRegAdjEMA(hlc3(period = AggregationPeriod.HOUR), 34, 34, 34, 3);
def LInEMA15Min = LinearRegAdjEMA(hlc3(period = AggregationPeriod.FIFTEEN_MIN), 34, 34, 34, 3);
def LInEMA3Min = LinearRegAdjEMA(hlc3(period = AggregationPeriod.THREE_MIN), 34, 34, 34, 3);

## #######################################################
# Charting & Formatting
# Plot each sequential line of your dashboard
# Use AssignValueColor to paint each line with your conditions
## #######################################################
declare lower;

plot hour4 = if IsNaN(close) then double.NaN else 1;
hour4.setPaintingStrategy(PaintingStrategy.POINTS);
hour4.setlineweight(5);
hour4.AssignValueColor(if LInEMA4Hour > VMA4hour then color.green else color.Magenta);
hour4.HideBubble() ;
hour4.HideTitle() ;

plot hour1 = if IsNaN(close) then double.NaN else 2;
hour1.setPaintingStrategy(PaintingStrategy.POINTS);
hour1.setlineweight(5);
hour1.AssignValueColor(if LInEMA1Hour > VMA1hour then color.green else color.red);
hour1.HideBubble() ;
hour1.HideTitle() ;

plot Min15X = if IsNaN(close) then double.NaN else 4;
Min15X.setPaintingStrategy(PaintingStrategy.POINTS);
Min15x.setlineweight(5);
Min15X.AssignValueColor(if LInEMA15Min > VMA15Min then color.green else color.red);
Min15X.HideBubble() ;
Min15X.HideTitle() ;

plot Min3X = if IsNaN(close) then double.NaN else 3;
Min3X.setPaintingStrategy(PaintingStrategy.POINTS);
Min3x.setlineweight(5);
Min3X.AssignValueColor(if LInEMA3Min > VMA3Min then color.green else color.red);
Min3X.HideBubble() ;
Min3X.HideTitle() ;


plot top = if IsNaN(close) then double.NaN else 8;
plot bottom = if IsNaN(close) then double.NaN else -3 ;
 
Last edited by a moderator:
Solution
Thank you Very Much, I really Appreciate your help. I use that for confirmation with other Combined to one multi Indicator. this will help in a clean chart by removing those Moving averages. Again. Thank you
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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