• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ichimoku Cloud

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

    Ichimoku Cloud

    Hi,

    I'm trying to code with the ichomoky cloud. However, I can't seem to find the right command to call the condition that price is above the positive cloud. Since you can only change the parameters for the Kijunsen en the TenkanSen, I don't know how to code it.

    I'm trying to code a positive barclose breaking throught the positive cloud.

    Please help me.

    #2
    Hello Robert87,

    Which specific script are you working with?

    For example:
    Print(IchimokuCloud(9, 26, 52).ChikouSpan[0]);
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      I'm using the indicator from this site(only 1 moku).
      I'm trying to code a price breakout above the cloud.
      I found out that the cloud is formed by the A span and the B span.
      I also found out that since it plots 26 bars into the future, I somehow have to code that in.

      I tried the following code to see where it plots(it might not be the exact code since I'm at work):

      if(IchimokuCloud(9,26,52)._SenkouSpanA[1] > IchimokuCloud(9,26,52)._SenkouSpanB[0] && IchimokuCloud(9,26,52)._SenkouSpanA[0] < IchimokuCloud(9,26,52)._SenkouSpanB[0])
      {
      EnterLong();
      }

      But this that does plot at the time I want(when the price actually crosses the cloud).

      So I've tried:

      if(Close[1] < (IchimokuCloud(9,26,52)._SenkouSpanA[27] && Close[0] > (IchimokuCloud(9,26,52)._SenkouSpanA[26]) But this does not work.

      So I tried:

      if(Close[1] < (IchimokuCloud(9,26,52)._SenkouSpanA[1] && Close[0] > (IchimokuCloud(9,26,52)._SenkouSpanA[0]) But this plots at the wrong time again.

      I hope you understand my dilemma.

      Comment


        #4
        Hello Robert87,

        Using Displacement on a chart to move a plot forward would be the same as using a bars ago value for the plot in code.

        Use prints to find why the conditions are not evaluating as true.

        For example:
        Print(string.Format("{0} | Close[1]: {1} < (IchimokuCloud(9,26,52)._SenkouSpanA[1]: {2} && Close[0]: {3} > (IchimokuCloud(9,26,52)._SenkouSpanA[0]: {4})", Time[0], Close[1], IchimokuCloud(9,26,52)._SenkouSpanA[1], Close[0], IchimokuCloud(9,26,52)._SenkouSpanA[0]));

        As a heads up, with the parenthesis you have suggested, I would not expect that code to compile. I was not able to make a print for that exact code.

        For a CrossAbove/CrossBelow there are methods for these.
        https://ninjatrader.com/support/help...crossabove.htm
        https://ninjatrader.com/support/help...crossbelow.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          This one doens't work:

          if(CrossAbove(IchimokuCloud(9,26,52).TenkanSen, IchimokuCloud(9,26,52).KijunSen))

          Comment


            #6
            Hello Robert87,

            Make a print for any condition that you would like to understand the behavior of.

            Below is a link to a forum post that demonstrates using prints to understand behavior.
            https://ninjatrader.com/support/foru...121#post791121

            As a heads up, the code you have suggested will not compile. There is no look back period which is required for CrossAbove().

            Further, this would not trigger when the price is crossing a plot, if this had been coded properly it would trigger when the TenkanSen and KijunSen plots cross each other.

            Try making a print for this. Print the Time[0], print IchimokuCloud(9,26,52).TenkanSen[1], print IchimokuCloud(9,26,52).KijunSen[1], print IchimokuCloud(9,26,52).TenkanSen[0] and print IchimokuCloud(9,26,52).KijunSen[0].

            Then include the output and the time where you are expecting the cross to have occurred. We will be able to tell from the print if the condition would evaluate as true or false.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by Robert87 View Post
              This one doens't work:

              if(CrossAbove(IchimokuCloud(9,26,52).TenkanSen, IchimokuCloud(9,26,52).KijunSen))
              What is the error returned by the statement?

              The syntax looks incorrect.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Fastbyte, Yesterday, 11:13 PM
              1 response
              1 view
              0 likes
              Last Post NinjaTrader_ChrisSch  
              Started by StealthM93, Yesterday, 07:58 PM
              1 response
              7 views
              0 likes
              Last Post bltdavid  
              Started by Mykro, Yesterday, 11:01 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by bauerjj10, Yesterday, 12:24 PM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Newtrader101, Yesterday, 06:01 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_EricB  
              Working...
              X