Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Painting bars based on condition question

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

    Painting bars based on condition question

    Hello,

    What would the code be for the following condition?

    If the MACD Histogram value is above the 0 line, and the MACD is above the 0 line then color price bars green. And the same for the inverse - color bars red.

    If you need reference, please see the following video around time: 3:45. Thanks.

    http://www.rockwelltrading.com/cust/...-software.html

    Would also like to know the code to get the Average Daily RANGE to print on the chart. See video at around 6:00 for the logic. Very simple.
    Last edited by ericadam; 09-04-2008, 11:09 PM.

    #2
    Bump.. anyone?

    Comment


      #3
      Code:
      if (MACD(12,26,9).Diff[0] > 0 && MACD(12,26,9)[0] > 0)
            BarColor = Color.Green;
      else if (MACD(12,26,9).Diff[0] < 0 && MACD(12,26,9)[0] < 0)
            BarColor = Color.Red;
      For Average Daily Range. You need to create a custom indicator. You would create a DataSeries and then store the calculation of CurrentDayOHL().CurrentHigh[0] - CurrentDayOHL.CurrentLow[0]. After you have this DataSeries, say we call it DailyRange, then we would go and run an SMA on it.

      Code:
      SMA(DailyRange, 7)[0];
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        HUGE, thank you so much

        Comment


          #5
          Is there anyway to print just the value of the avg daily range, 7 in the charts versus a plot

          Comment


            #6
            Sure. Just create the custom indicator and instead of doing something like Plot0.Set(SMA(DailyRange, 7)[0]);

            Just don't set a value to Plot0 and use DrawTextFixed() to write out the value of SMA(DailyRange, 7)[0].
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              How would I create the data series to store the calculation?

              Comment


                #8
                http://www.ninjatrader-support.com/H...iesObject.html
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Island_Boy_Trading, Today, 07:39 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_ChristopherJ  
                Started by cmarkb, Today, 07:19 AM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by wjadevries, Today, 03:29 AM
                1 response
                15 views
                0 likes
                Last Post NinjaTrader_Jim  
                Started by Oracletrades, Yesterday, 09:10 PM
                1 response
                119 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by ginx10k, Today, 07:04 AM
                2 responses
                8 views
                0 likes
                Last Post ginx10k
                by ginx10k
                 
                Working...
                X