Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Coloring Based on Price Action

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

    Coloring Based on Price Action

    hey I'm trying to make an indicator based on whole number pips + price action and then using then coloring the background accordingly.

    I don't know how to set the whole pip numbers as the target. If I was using a swing high/low I know how to do that based on the swing indicator. I basically want to color the chart every time price moves through a whole pip number.

    If it breaks above closes above a whole number pip background goes green, if it breaks below closes below a whole number chart goes red. I just don't know how to set the targets as the whole pip numbers.

    #2
    Originally posted by matkiefer View Post
    ... if it breaks above closes above a whole number pip background goes green, if it breaks below closes below a whole number chart goes red. I just don't know how to set the targets as the whole pip numbers.
    The entire chart's color changes, or just the bar on which the condition occurs?

    Comment


      #3
      Either Or, it would be nice if the whole chart did, I know I can use

      if { such and such happens
      BackColor = Color.Whatever }

      I just don't know how to make it happen when the bar is breaking above / closing about a whole number pip that's user defined. Like every 5 ticks starting a 0.0 basically or every 10 ticks starting at 0.0 kind of thing

      Comment


        #4
        Hello matkiefer,

        Thank you for your note.

        You could use the % operator to check if the close is on a whole number.

        For example, every time price Closes on a whole number it will paint the background green.

        if (Close[0] % 1 == 0)
        {
        BackColor = Color.Green;
        }
        CameronNinjaTrader Customer Service

        Comment


          #5
          How would I check it if price is already within that whole number though?

          Comment


            #6
            Originally posted by matkiefer View Post
            Either Or, it would be nice if the whole chart did, I know I can use

            if { such and such happens
            BackColor = Color.Whatever }

            I just don't know how to make it happen when the bar is breaking above / closing about a whole number pip that's user defined. Like every 5 ticks starting a 0.0 basically or every 10 ticks starting at 0.0 kind of thing
            Code:
            double definedLevel = someValue; //may want to make this into a parameter?
            Code:
            if (Close[0] > definedLevel && Open[0] < definedLevel)
            {
            ChartControl.BackColor = Color.LightBlue;
            }
            if (Close[0] < definedLevel && Open[0] > definedLevel)
            {
            ChartControl.BackColor = Color.Gold;
            }

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by JTizz, Today, 01:20 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by omermirza, Today, 12:39 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by mballagan, Today, 01:02 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by larkmail, Today, 12:30 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by Danila, Today, 11:08 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X