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

LBR PaintBars

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

    LBR PaintBars

    Can anyone program the following LBR PaintBars indicators for ninja, please?



    Thanks.

    #2
    Welcome here Everest, if no one takes it up here as a project you could always contact a certified NinjaScript consultant from this list :

    BertrandNinjaTrader Customer Service

    Comment


      #3
      post a sample chart with the inputs used. It looks simple from the description. I will give it a try.

      Comment


        #4
        Here it is, it is very simple actually

        Last edited by Everest; 11-21-2011, 02:16 AM.

        Comment


          #5
          I think it should do let me know if something needs to be corrected
          Attached Files

          Comment


            #6
            Hey, great thank you. it is almost done, but indicator is not showing regular bars in ninja. here is two screenshots of the same period.

            Screen from Thinkorswim



            Screen from Ninja
            http://s017.radikal.ru/i411/1111/da/307fce9b1e1c.png
            (select, copy and paste then)
            Last edited by Everest; 11-21-2011, 04:58 AM.

            Comment


              #7
              I know where the problem is .. I will fix it in a little bit ...

              Comment


                #8
                updated indicator attached ...
                From the second chart you posted, I realized that the indicator is not supposed to highlight the bars that are in b/w the two Upper and Lower Volatility plots ... so I made the adjustments.

                Can you give some information, how you use this indicator? I think you are using it to filter out ranging market areas.
                Attached Files

                Comment


                  #9
                  Sherazwaqar, thank you for your efforts, you are very close, but it still has differences, but they are very little - 1 or 2 bars.

                  Here is how it looks like in thinkorswim code, if it tells you something that will be of help.:

                  # @new
                  # @reference
                  #
                  # thinkorswim, inc. (c) 2011
                  #

                  input HLLength = 16;
                  input ATRLength = 9;
                  input factor = 2.5;
                  input paintBars = yes;

                  def AATR = factor * Average(AvgTrueRange(high, close, low, ATRLength), ATRLength);
                  def band1 = Lowest(low, HLLength) + AATR;
                  def band2 = Highest(high, HLLength) - AATR;

                  plot UpperVolatility = close > band1 and close > band2;
                  plot LowerVolatility = close < band1 and close < band2;

                  UpperVolatility.SetPaintingStrategy(PaintingStrate gy.BOOLEAN_POINTS);
                  UpperVolatility.SetLineWeight(3);
                  UpperVolatility.SetDefaultColor(Color.GREEN);
                  UpperVolatility.hide();
                  LowerVolatility.SetPaintingStrategy(PaintingStrate gy.BOOLEAN_POINTS);
                  LowerVolatility.SetLineWeight(3);
                  LowerVolatility.SetDefaultColor(Color.RED);
                  LowerVolatility.hide();

                  DefineGlobalColor("Bullish", Color.GREEN);
                  DefineGlobalColor("Bearish", Color.RED);
                  AssignPriceColor(if !paintBars
                  then Color.CURRENT
                  else if UpperVolatility
                  then globalColor("Bullish")
                  else if LowerVolatility
                  then globalColor("Bearish")
                  else Color.CURRENT);

                  Comment


                    #10
                    I am employing essentially the similar logic as you have posted in the thinkscript code. Can u please post a chart from the thinkorswim terminal for ES Dec Contract. Also please mention the time template used.

                    Comment


                      #11
                      one moment
                      Last edited by Everest; 11-21-2011, 12:21 PM.

                      Comment


                        #12
                        Well I have scanned through the code, and the reason for the differences for 1 or bar is that I have put in a condition in indicator to return 0 values if there are less 16 bars (length for calculating the highest high and lowest low), if i get rid of that condition, the charts are similar.
                        In my view the indicator should not be calculating any values until it has 16 bars on the chart, because the highest high and lowest low returned are not in conformity with the indicator logic.
                        If you like I can repost the indicator ... also if you increase the number of days on your thinkorswim terminal, the number of volatility bands will change as it will have more bars for the calculation of first value, and for the ninjascript that I have written values will remain the same, as it is already employing the logic as it should be.

                        Comment


                          #13
                          Can you do it, please ?

                          Comment


                            #14
                            Sure. Here it is ...
                            Attached Files

                            Comment


                              #15
                              Sherazwaqar, I use it to find my entry points after Divergence has happened. Market makes new high, but momentum indicator shows that momentum is slowing down and it doesn't make a new high. After this I start looking for paintbar to change color and this is my entry.
                              Example:

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              148 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post tkaboris  
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,283 views
                              0 likes
                              Last Post Leafcutter  
                              Working...
                              X