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

Paintbar for SMA

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

    Paintbar for SMA

    Hello, I am interested in a Ninjascript for an SMA paint bar is this availabe?

    Esentially, I have a 20 bar moving average (MA) and everytime a bar closes under the MA I want it to turn red and when it closes OVER the MA it would turn green.

    Thank you.

    #2
    Hi woodpecker,

    Welcome to the NinjaTrader forums! I'm not aware of an indicator or strategy that does exactly this.

    If you want to get started on this your own, the strategy wizard is a good place to start. You can create this condition and the bar coloring action within a point and click interface. Please see here for help with NinjaTrader's strategy wizard:


    If you have limited time or programming experience, please consider one of our 3rd party NinjaScript consultants to create this for you:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan,

      I tried it but must have done something incorrectly. (I also assume you suggested using the strategy as opposed to the ninjascript indicator).

      Anyway, is the a video tutorial somewhere?

      Thank You

      Comment


        #4
        woodpecker,

        Unfortunately, there are no video tutorials on making indicators / strategies. However we do have several sections in the help guide and forum you may find helpful.

        Educational Resources : http://www.ninjatrader.com/support/h..._resources.htm

        Tutorials : http://www.ninjatrader.com/support/h...?tutorials.htm

        Reference Samples : http://www.ninjatrader.com/support/f...splay.php?f=30

        Additionally, we have a webinar you may find helpful on Automated Strategy Development. Please find a link below.

        10/04 @ 5:30 PM EDT : http://www.ninjatrader.com/webinars

        Please let me know if I can assist you further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          SMAOverUnderPaintBar

          Let me know if this works for you.

          Exported with NT7.7
          Attached Files

          Comment


            #6
            Hi phoenix,
            it works for me, nice. It would be great if we could have a choice between the MA's and if the line could be activated or not and colored when it goes down or up.
            br

            Comment


              #7
              Works great Thanks!

              Market is closed now so I will let you know when it is running RT but the setup is perfect. The only thing I am confused about is the "live"bar, which is white on the picture you posted but green on mine. And it is below the MA. Obviuosly, white (or anything other than red or green) is a better choice but, like I said, I will check back during market hours.

              Thanks again.

              Comment


                #8
                To woodpecker...The indicator is programmed to "Calculate on Bar Close" (you can change this in the indicator panel). I used the white bar simply to illustrate this.

                Also, I did a second version (zip file and image attached below) that will paint the wicks on candlesticks, based on a second SMA (default is 50 periods). Black wicks if below the 50SMA and white wicks if above.

                To mate41...I do not know how to program for the multi-MA input. If you want to make the line invisible, set the color to transparent. Programming for a multi-color line...based on the slope of the line...will have to be done when I have the time, hopefully within the next week or so.

                10/2/2011 Edit Orginal .zip file had an error. Replaced with correct indicator file.
                Attached Files
                Last edited by phoenix; 10-02-2011, 08:49 PM.

                Comment


                  #9
                  Hi phoenix,
                  this version 2 won't work for me; did you post the good one ?
                  If i change the sma periods they return to their default state after an "apply". Added SMAvg.Set(uuu) !
                  Only for use with candelstikcs because the candleoutlinecolor is used.
                  There is only 1 sma available to change the colorline.
                  Why did you add a second SMA ?
                  -------------------------------------------------------------------------------
                  About the multi-ma, there is a script available "ManyMovingAverages". Maybe this could be an example to add this possibility ?
                  I like manipulating the bars if this can contribute to a simplification of the chart ( to many lines for example). But i'm only a beginner and limited to programming simple scripts.
                  All the best.
                  Attached Files
                  Last edited by mate41; 10-02-2011, 08:06 AM.

                  Comment


                    #10
                    Hello,
                    this is an assembly of two sources without other MA than the EMA.
                    Attached Files

                    Comment


                      #11
                      mate41

                      Will give the ManyMovingAverages a look. Usually can follow the scripts, so thanks for this. Not at my trading computer this weekend...will have to look at the other tomorrow.

                      phoenix

                      Comment


                        #12
                        to mate41...don't know what happened. If you look at the jpeg below, it shows both lines...but the downloaded file for V2 wasn't right. It would only show one line, and only had one Plot. ?Late Friday night, programming...QC - Fail.?

                        Attached is the correct file.

                        Will look at the rest tomorrow after trading.
                        Attached Files

                        Comment


                          #13
                          Hi phoenix,
                          here is an other version with a MA choice.
                          Have to add the choice about the bar colors and ouline colors.
                          Attached Files

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Segwin, 05-07-2018, 02:15 PM
                          10 responses
                          1,768 views
                          0 likes
                          Last Post Leafcutter  
                          Started by Rapine Heihei, 04-23-2024, 07:51 PM
                          2 responses
                          30 views
                          0 likes
                          Last Post Max238
                          by Max238
                           
                          Started by Shansen, 08-30-2019, 10:18 PM
                          24 responses
                          943 views
                          0 likes
                          Last Post spwizard  
                          Started by Max238, Today, 01:28 AM
                          0 responses
                          10 views
                          0 likes
                          Last Post Max238
                          by Max238
                           
                          Started by rocketman7, Today, 01:00 AM
                          0 responses
                          7 views
                          0 likes
                          Last Post rocketman7  
                          Working...
                          X