Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Ichimoku indicator alert

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with Ichimoku indicator alert

    Hi, I have the Ichimoku cloud indicator active on my charts and I'm trying to setup a buy alert that will go off when the following conditions are true.

    1. The price is above the conversion line.
    2. The price is above the green cloud (on tradingview the outline of the green cloud is called lead 1, and the outline of the red cloud is called lead 2).

    And vice verse for going short.

    However the indicator seems to only have base line, lagging span, lead span a and lead span b. None of these seem to be the cloud line. See the image below https://i.gyazo.com/e0e4d8b69810560ecf5e5172f31ad5b0.png.

    Lead span a and lead span b are just two more lines, kinda like the lagging span.

    What is the line that creates the green and red cloud called? On tradingview it's called lead 1 and lead 2.

    I downloaded this indicator from NT app store and it was created by NinjaTrader Jim.

    #2
    I've opened up the source code of the Ichimoku indicator by Jim but I honestly have no idea where to start. This is what the code looks like for the indicator on tradingview

    //@version=4
    study(title="Ichimoku Cloud", shorttitle="Ichimoku", overlay=true)

    conversionPeriods = input(9, minval=1, title="Conversion Line Periods"),
    basePeriods = input(26, minval=1, title="Base Line Periods")
    laggingSpan2Periods = input(52, minval=1, title="Lagging Span 2 Periods"),
    displacement = input(26, minval=1, title="Displacement")

    donchian(len) => avg(lowest(len), highest(len))

    conversionLine = donchian(conversionPeriods)
    baseLine = donchian(basePeriods)
    leadLine1 = avg(conversionLine, baseLine)
    leadLine2 = donchian(laggingSpan2Periods)

    plot(conversionLine, color=#0496ff, title="Conversion Line")
    plot(baseLine, color=#991515, title="Base Line")
    plot(close, offset = -displacement + 1, color=#459915, title="Lagging Span")

    p1 = plot(leadLine1, offset = displacement - 1, color=color.green,
    title="Lead 1")
    p2 = plot(leadLine2, offset = displacement - 1, color=color.red,
    title="Lead 2")
    fill(p1, p2, color = leadLine1 > leadLine2 ? color.green : color.red)


    It seems like the cloud lines (lead 1 and lead 2) are created here

    leadLine1 = avg(conversionLine, baseLine)
    leadLine2 = donchian(laggingSpan2Periods)

    but Jims code is much more complex... I have no idea where to start.

    Comment


      #3
      Hi matty89, thanks for your note.

      The SenkouSpanA and SenkouSpanB lines are what make up the cloud portion of the indicator. By default, there is an offset applied called Cloud Offset. If you set that to 0 the cloud and the two plots will match up.

      Please let me know if I can assist any further.

      Comment


        #4
        Originally posted by NinjaTrader_ChrisL View Post
        Hi matty89, thanks for your note.

        The SenkouSpanA and SenkouSpanB lines are what make up the cloud portion of the indicator. By default, there is an offset applied called Cloud Offset. If you set that to 0 the cloud and the two plots will match up.

        Please let me know if I can assist any further.
        Thank you I'm setting it up now. If I want the alert to go off every time, should I set the rearm type to remove alert? Also do the alerts play a sound or something so I might be away from my laptop etc.

        *edit* Actually this doesn't seem correct, now I've lost my "forward projection" of the cloud. It was set to 26 before hand but changing it to 0 moves the entire cloud back.

        Is there a way I can just set the lines to match up with the cloud without moving the entire cloud back?
        Last edited by matty89; 03-12-2020, 11:57 AM.

        Comment


          #5
          Hi matty89, thanks for your reply.

          I see "On Condition Reversed" used a lot for alerts. For the condition reverse, To rearm the alert on every bar, set it to On Bar Close. There is also the Timer option. See here for a full list and documentation:

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          656 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          371 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          579 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X