Ichimoku Cloud Momentum & Trend Indicator «NoaTrader» for ThinkOrSwim

samer800

Moderator - Expert
VIP
Lifetime
ichomo-TOS_CHARTS.png


Author Message:
If you like Ichimoku cloud and use it in your analysis, or you are new to it and sometimes gets tricky to figure out all the details, this indicator tries to simplify that and visualize the change of trend and momentum relative to the past based on ichimoku.
The RED/GREEN columns are showing momentum strength while the black diamond line suggests the trend change. The conditions are simple enough to check them out on the script.
As you can see highlighted cyan circles on the chart as major important signals on the chart of Bitcoin daily timeframe.
This script tries to be complementary to the ichimoku cloud itself and cannot replace the levels represented by the cloud on chart.

CODE:

CSS:
# https://www.tradingview.com/v/R225y8rU/
#//@NoaTrader
#indicator(title="Ichimoku Cloud Momentum & Trend Indicator «NoaTrader»", shorttitle="Ichi MTI", overlay=false)
# Converted by Sam4Cok@Samer800    - 02/2024
declare lower;

input colorBars = yes;
input UseWeightedValueForConditions = yes; #,"Use weighted value for conditions", group = "Indicator")
input ConversionLineLength = 9; #, minval=1, title="Conversion Line Length", group = "Ichimoku")
input BaseLineLength = 26; #, minval=1, title="Base Line Length", group = "Ichimoku")
input LeadingSpanBLength = 52; #, minval=1, title="Leading Span B Length", group = "Ichimoku")
input LaggingSpan = 26; #, minval=1, title="Lagging Span", group = "Ichimoku")

def na = Double.NaN;
def is_weighted = UseWeightedValueForConditions;

script donchian {
    input len = 9;
    def hh = Highest(high, len);
    def ll = Lowest(low, len);
    def donchian = (hh + ll) / 2;
    plot out = donchian;
}
def conversionLine = donchian(ConversionLineLength);
def baseLine = donchian(BaseLineLength);
def leadLine1 = (conversionLine + baseLine) / 2;
def leadLine2 = donchian(LeadingSpanBLength);
def lag = LaggingSpan - 1;
def cloud_top = Max(leadLine1[lag], leadLine2[lag]);
def cloud_bot = Min(leadLine1[lag], leadLine2[lag]);
#// momentun over cloud
def is_mom_over_top = close > cloud_top[lag];
def is_mom_under_bot = close < cloud_bot[lag];
#// price over cloud
def is_price_over_top = close > cloud_top;
def is_price_under_bot = close < cloud_bot;
#//Totals
def total1 = if is_mom_over_top then (if is_weighted then 5 else 1) else
             if is_mom_under_bot then -(if is_weighted then 5 else 1) else 0;
#//if is_price_over_top
def total2 = if is_price_over_top then total1 + (if is_weighted then 5 else 1) else
             if is_price_under_bot then total1 - (if is_weighted then 5 else 1) else total1;
#// cloud is green or red
def total3 = if leadLine1 > leadLine2 then total2 + (if is_weighted then 4 else 1)
                                      else total2 - (if is_weighted then 4 else 1);
def total4 = if conversionLine > baseLine then total3 + (if is_weighted then 3 else 1)
                                          else total3 - (if is_weighted then 3 else 1);
def total5 = if close > conversionLine then total4 + 1 else total4 - 1;
def total6 = if close > baseLine then total5 + (if is_weighted then 2 else 1)
                                 else total5 - (if is_weighted then 2 else 1);
def w_sum = if is_weighted then 20 else 6;
def trend = if is_mom_over_top and is_price_over_top then 1 else
            if is_mom_under_bot and is_price_under_bot then -1 else 0;
def total = total6 * 100 / w_sum;
def col = if isNaN(total) then 0 else
          if total > 0 then if total < 25 then 128 else if total < 50 then 190 else 255  else
          if total > -25 then 128 else if total > -50 then 190 else 255;
def trnLine = trend * 100;
plot trendLine = trnLine;
plot momHist = total;

trendLine.SetLineWeight(2);
trendLine.SetDefaultColor(Color.WHITE);
momHist.AssignValueColor(if total > 0 then CreateColor(0, col, 0) else CreateColor(col,0, 0));
momHist.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);

plot sigUp = if trend < 0 and trend!=trend[1] and total == -100 then -110 else na;
plot sigDn = if trend > 0 and trend!=trend[1] and total == 100 then 110 else na;

sigUp.SetPaintingStrategy(PaintingStrategy.SQUARES);
sigDn.SetPaintingStrategy(PaintingStrategy.SQUARES);
sigUp.SetDefaultColor(Color.CYAN);
sigDn.SetDefaultColor(Color.MAGENTA);

AssignPriceColor(if !colorBars then Color.CURRENT else
                 if total > 0 then CreateColor(10, col, 10) else CreateColor(col,10, 10));
#-- END of CODE
 

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
403 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