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

help

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

    help

    Could you code this for me?

    When two HMA are rising they color the candles blue, when they are falling they color the candles red and when they aren't going in the same direction they are white?

    #2
    Hello,

    Thank you for the post.

    While our support can not program items for you, we can provide resources to help you learn if you would like to develop items yourself. If you would like further information to learn how to do this, please let me know. Otherwise if you are looking for a developer I could have our business development department reach out to you for third party resources.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Yes please help me

      Comment


        #4
        Hello,

        Thank you for the reply.

        The easiest way to get started would be to create a new empty indicator, you can do this by going to Tools -> New NinjaScript -> Indicator. Because you are only trying to color bars, you could remove the input MyInput0 while going through the new indicator wizard. Also you can remove the Plot0 in the wizard. Finally click next until you can finish the wizard and a new file opens.

        The most simple example of a Rising and Falling condition would be in this helpguide document: http://ninjatrader.com/support/helpG...sub=plotcolors
        This sample changes the Plot color of the indicator which is almost what you want already, you just need to re form the sample to change the BarColor instead.

        To change Candle colors, you would use BarColor: http://ninjatrader.com/support/helpG...htsub=barcolor

        To combine the two samples, you would use the conditions of rising/falling from the first sample and the BarColor property from the second. In this case, you would also need to replace check the HMA indicator.

        for the HMA you can find its syntax here: http://ninjatrader.com/support/helpG...ghlightsub=hma

        the syntax would look like the following:

        Code:
        if (Rising(HMA(20))
            BarColor = Color.Magenta;
        else if (Falling(HMA(20))
            BarColor = Color.Purple;
        To test the indicator, you would need to insert the above code into the new indicator in the region OnBarUpdate after the opening bracket { and before the closing }. Next Compile by pressing F5, the indicator will be generated. If there are no errors you should hear a sound and then have access to the indicator in the Indicators menu on a chart.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi,
          I had some time and put together something for you. See attached.

          Let me know if that's what you were looking for.

          sandman
          Attached Files

          Comment


            #6
            Looks. Great! Thanks

            Comment


              #7
              Good. Now you can use this indicator to open it and look at and read the code. Then I suggest you look for the "4" and "7" and change them in the code to the specific periods you want to actually use. Follow NT's instructions of how "to compile" and close/save the file.

              Anyway, that's just my humble suggestion if you want to get into coding.

              sandman

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,265 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X