Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

4C Pine Code

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

    4C Pine Code

    A very simple but good indicator for showing divergence. It is in pine script.

    Hoping some kind soul can make this for NT8. A pic is attached showing what it looks like.

    Thanks in advance.

    study(shorttitle = "MACD 4C", title = "4 colour MACD")
    fastMA = input(title="Fast moving average", type = integer, defval = 12, minval = 7)
    slowMA = input(title="Slow moving average", type = integer, defval = 26, minval = 7)
    lastColor = yellow
    [currMacd,_,_] = macd(close[0], fastMA, slowMA, 9)
    [prevMacd,_,_] = macd(close[1], fastMA, slowMA, 9)
    plotColor = currMacd > 0
    ? currMacd > prevMacd ? lime : green
    : currMacd < prevMacd ? maroon : red
    plot(currMacd, style = histogram, color = plotColor, linewidth = 3)
    plot(0, title = "Zero line", linewidth = 1, color = gray)
    Attached Files

    #2
    Hello Segwin,

    This thread will remain open for any community members that would like to create this script as a convenience to you.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Segwin View Post
      A very simple but good indicator for showing divergence. It is in pine script.

      Hoping some kind soul can make this for NT8. A pic is attached showing what it looks like.

      Thanks in advance.

      study(shorttitle = "MACD 4C", title = "4 colour MACD")
      fastMA = input(title="Fast moving average", type = integer, defval = 12, minval = 7)
      slowMA = input(title="Slow moving average", type = integer, defval = 26, minval = 7)
      lastColor = yellow
      [currMacd,_,_] = macd(close[0], fastMA, slowMA, 9)
      [prevMacd,_,_] = macd(close[1], fastMA, slowMA, 9)
      plotColor = currMacd > 0
      ? currMacd > prevMacd ? lime : green
      : currMacd < prevMacd ? maroon : red
      plot(currMacd, style = histogram, color = plotColor, linewidth = 3)
      plot(0, title = "Zero line", linewidth = 1, color = gray)
      This is the simple MACD crossover, already in download section by Paul with some eye candy, here:


      Cheers!
      Last edited by aligator; 11-12-2017, 01:44 PM.

      Comment


        #4
        Originally posted by aligator View Post
        This is the simple MACD crossover, already in download section by Paul with some eye candy, here:


        Cheers!
        Thanks however it is not the same thing. A normal MACD does not do the same thing.

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello Segwin,

          This thread will remain open for any community members that would like to create this script as a convenience to you.

          You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
          Thank you.

          Comment


            #6
            Originally posted by Segwin View Post
            Thanks however it is not the same thing. A normal MACD does not do the same thing.
            Does not do what thing? You can see the same divergence on MACD oscillator plot.

            Comment


              #7
              Originally posted by aligator View Post
              Does not do what thing? You can see the same divergence on MACD oscillator plot.
              Hello Alligator,

              Please refer to attached screen grab. As you can see they do not do the same thing

              Thank you for your post.
              Attached Files

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NRITV, Today, 01:15 PM
              2 responses
              9 views
              0 likes
              Last Post NRITV
              by NRITV
               
              Started by frankthearm, Today, 09:08 AM
              7 responses
              31 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by maybeimnotrader, Yesterday, 05:46 PM
              5 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by quantismo, Yesterday, 05:13 PM
              2 responses
              20 views
              0 likes
              Last Post quantismo  
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              33 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X