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 jonfan45, Today, 06:06 PM
                0 responses
                8 views
                0 likes
                Last Post jonfan45  
                Started by rustyspring, Today, 05:15 PM
                0 responses
                9 views
                0 likes
                Last Post rustyspring  
                Started by xulu13, Today, 05:01 PM
                0 responses
                12 views
                0 likes
                Last Post xulu13
                by xulu13
                 
                Started by Pbarrionuevo, Today, 04:30 PM
                0 responses
                9 views
                0 likes
                Last Post Pbarrionuevo  
                Started by vantojo, Today, 01:39 PM
                0 responses
                20 views
                0 likes
                Last Post vantojo
                by vantojo
                 
                Working...
                X