Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator for Painting Trending Bars

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

    Indicator for Painting Trending Bars

    I created this new topic on purpose rather than continue in my previous topic so people can access the zip file right here in 1st post. Forum moderators can delete the other one if you deem that is better for the community.

    Never did any coding, this is my first Ninja script and it started just two days ago. No credit on my part, but big THANKS to NinjaTrader_Chelsea who got me started by providing me with all the links I need, and to NinjaTrader_Kate who followed through later on, and more so to eDanny who provided more instructions beyond just coding (I prefer to skip all the details here).

    This indicator paints bars with the same color for as long as the trend remains. It does not change the bar shape like Heikin-Ashi indicator does, which I do not prefer. The simple logic of the indicator is to compare Close(current) with (Average Close - ATR*Percent). If greater, bullish trend. If less, bearish trend. You have two parameters to control the look of the chart. One is how many bars you want to look back for the average close, and the other is how much (in terms of percent) ATR you want to include in the formula. You can choose 0% ATR if you want to and it becomes a simple comparison between current close and the average close of certain amount of bars.

    Generally, the more bars you use the longer the trend remains. The less bars you use the more frequent changes of the trend. Likewise, the more ATR (say 1 or 100%) applied the less changes of the trend. I attached a screenshot with looking back bars set at 6 and 20, respectively. ATR was 0.5 for both.

    Again, big THANKS to Chelsea, Kate and eDanny. It's your baby.

    Last but not the least, c stands for Chelsea, d for eDanny and k for Kate.
    Attached Files

    #2
    Hello zhawenx,

    Thank you for your post.

    I'm glad to see you got it working! I'd invite you to post this in the User App Share, which you can do here:

    Upload tools and add-ons that you build to share through the NinjaTrader Ecosystem User App Share.


    That way it's easy to find for our users that may be interested in such an indicator. Also, thanks for naming it after us, I'm quite flattered to be included.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Just uploaded the files in User App Share.

      Comment


        #4
        I have downloaded this specific "Paint Trending Bars" indicator from the ecosystem by zhawenx but it doesn't show up in NT8 strategy builder. I want to backtest with this indicator but I'd like to find a way to make it usable in strategy builder because I have no coding experience myself. I read some other posts saying how I need to use AddPlot() to make it usable in strategy builder but, as previously stated, I have no coding experience and I fail to figure out what to add a plot to in order to identify an uptrend/downtrend play scenario. Specifically, I need a way to use and change the 3 main things [Period, ATR Percent, and State of Up Color/Down Color].

        For example, the strategy would plot the indicator settings and I want to make the Period 6 and ATR Percent 0.5. I need those variables to be changeable via the strategy inputs window. The uptrend or downtrend should be displayed as per the indicators original parameters, but I want the strategy to buy/sell on whatever trend I assign within strategy builder: "EnterLong" on an "Up Color" or vice versa. Please help me make a zipfile to import.​

        Comment


          #5
          Hello chasep7328,

          Thanks for your note.

          The Paint Trending Bars indicator from the User App Share does not contain plots so the indicator cannot be used in the Strategy Builder. Only indicators that contain plots are able to be used in a Strategy Builder strategy.

          To make this indicator accessible in the Strategy Builder, you would have to modify the script yourself by adding a plot to the indicator using the AddPlot() method. A value could then be assigned to the plot by calling Valu[0] = 'x' where 'x' is the value you want to assign to that plot.

          You could view this help guide page for more information about using the AddPlot() method and sample code: https://ninjatrader.com/support/help...t8/addplot.htm

          I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript: https://ninjatrader.com/support/help..._resources.htm

          If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first: https://ninjatrader.com/support/help...g_concepts.htm

          Please note that in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

          This thread will also be open to other community members to share their insights or modify the script at your request.​

          Let me know if I may assist further.
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X