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

SMAOverUnderPaintBar

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

    SMAOverUnderPaintBar

    I downloaded this indicator and really like it but I am trying to get it to only paint up bars above or down bars below. I would like for down bars above and up bars below to be neutral bars.

    It has: if (close[0] > SMAvg[0])

    I'm trying to add: Open[0] > SMAvg[0] & Open[0] < Close[0]

    I have searched all thru the site and can't find what I need to make it happen. Any help would be greatly appreciated.
    Thanks,
    Bryan Griggs
    [email protected]

    #2
    Hello BryanGriggs,
    Welcome to the forum and I am happy to assist you.

    Seems you missed a &. The correct code will be,

    Code:
    if (Open[0] > SMAvg[0] && Open[0] < Close[0])
    {
       //do something
    }
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Sometimes you just have to walk away. First Joydeep I'd like to say Thank You so much for your help and reply. Second I want to say NinjaTrader is the BEST! Second to none! I had put in the "&" but realized this morning that I was saving everytime and not compiling. Daaaaaa! I'm gonna work to make this indicator better (in my opinion). Here you can see a screen shot from just this mornings session that shows the possobilites. Thanks again Joydeep and I'll keep you posted.
      Bryan
      Last edited by BryanGriggs; 09-28-2012, 08:33 AM.

      Comment


        #4
        Hello BryanGriggs,
        Thanks for your note.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          With Neutral Bars

          I have attached a modified file of the SMAOverUnderPaintBar. I renamed it as PriceOverUnderMAPaintBar. Go to chart data settings and make the color for bars up and down the same color. This will be your Neutral color. If the bar closes over your MA and is an up bar, it will be painted green. If it closes above your MA but is a down bar, it will not be painted and will show as your selected Neutral color. I am still working on this in my spare time and would like the indicator to allow for different MA options as well as be able to select Up/Down bar colors. Any help would be great and I will Update when complete but may be a while.
          Thanks
          Attached Files

          Comment


            #6
            Hello BryanGriggs,
            Please add additional plot values using the Add() method to plot multiple MA.


            To create user defined inputs please refer to this post


            To create user defined inputs for coloring the bars please refer to this post which further illustrates it
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by alifarahani, 04-19-2024, 09:40 AM
            8 responses
            52 views
            0 likes
            Last Post alifarahani  
            Started by mmckinnm, Today, 01:34 PM
            2 responses
            4 views
            0 likes
            Last Post mmckinnm  
            Started by Conceptzx, 10-11-2022, 06:38 AM
            3 responses
            60 views
            0 likes
            Last Post NinjaTrader_SeanH  
            Started by f.saeidi, Today, 01:32 PM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by traderqz, Today, 12:06 AM
            9 responses
            16 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X