MTF Stacked Averages?

Piper2808t

Active member
2019 Donor
VIP
Looking to turn the below script into an MTF
Ruby:
def H = highestAll( high );

def ll=LowestAll(data = LOW);

def avgC12 = expAverage(close,8);
def avgC26 = expAverage(close, 12);
def avgC10 = expAverage(close, 10);
def avgC20 = expAverage(close, 20);
def avgC50 = expAverage(close,30);

def avgDiff12_26_1 = expAverage(avgC12[1] - avgC26[1], 120);
def avgDiff12_26 = expAverage(avgC12 - avgC26, 120);

def condition1 = (avgC12 - avgC26 > 0) or (avgDiff12_26_1 < avgDiff12_26);
def condition2 = avgC12 - avgC26 > avgDiff12_26;
def condition3 = (avgC10 > avgC20) or (avgC10 > avgC50);
def condition4 = avgC20 > avgC50;
#def condition5 = close>vwap;
def finalCondition =if (condition1 and condition2) and (condition3 and condition4) then 1 else 0;
#def finalCondition =if (condition1 and condition2) and (condition3 and condition4) and (condition5) then 1 else 0;




addCloud( if( finalCondition ,h ,double.nan),ll , color.cyan , color.white);
addCloud( if( finalCondition==0 ,h ,double.nan),ll , Color.white , color.cyan);
 
Last edited by a moderator:

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

Thread starter Similar threads Forum Replies Date
E MTF Stacked Moving Averages Questions 3
I MTF Average Daily Close Line Questions 2
D MTF Stoch Signals Questions 0
B MTF Previous Week Open / Close Questions 1
S MTF Shaded EMA Questions 4

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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