Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 key reversal paintbar or triangle on panel 1

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

    NT8 key reversal paintbar or triangle on panel 1

    Looking to create a up/down triangle on panel 1 for the NT8 key reversal indicator.

    Was trying this but could not get it: TIA for any help.


    }
    else if (State == State.DataLoaded)
    max = MAX(High, Period);
    {
    }
    }

    protected override void OnBarUpdate()
    {
    if (CurrentBar < Period + 1)
    return;

    double DesiredValue2 = (Value[0] = High[0] > max[1] && Close[0] < Close[1]) ? 1: 0;
    if (DesiredValue2 == 1.0) Draw.TriangleDown(this, CurrentBar.ToString(), false, 0, High[0] + (TickSize * 10), Brushes.Red);
    if (DesiredValue2 == 0) RemoveDrawObject(CurrentBar.ToString());
    }

    #2
    Hello reedstickets,

    Thanks for your post.

    Can you provide some clarity regarding the specific issue you are having?
    Compile error?
    Run time error?
    Not drawing?
    Etc?

    Comment


      #3
      Than you Paul,

      I am getting a compile error. I will have to run it again, but it is something with the MAX and period.

      Thanks for any help.

      Comment


        #4
        Hello reedstickets,

        Thanks for your reply.

        Has the variable "Period" been defined and has a default value?

        Comment


          #5
          Yes, but it says "the name Period does not exists in the current context" The name MAX does not exists in the current context".

          Thanks for any help:
          ------------------------------

          Period = 1;

          }
          else if (State == State.DataLoaded)
          max = MAX(High, Period);
          {
          }
          }

          protected override void OnBarUpdate()
          {
          if (CurrentBar < Period + 1)
          return;

          double DesiredValue2 = (Value[0] = High[0] > max[1] && Close[0] < Close[1]) ? 1: 0;
          if (DesiredValue2 == 1.0) Draw.TriangleDown(this, CurrentBar.ToString(), false, 0, High[0] + (TickSize * 10), Brushes.Red);
          if (DesiredValue2 == 0) RemoveDrawObject(CurrentBar.ToString());
          }

          Comment


            #6
            Hello reedstickets,

            Thanks for your reply.

            You would need to make sure the Period is not only defined with a value but the type of variable that it is.

            Just below the Public Class name, do you have something like:

            private MAX max;
            private int Period;

            Comment


              #7
              Thanks Paul,

              I had that part incorrect in the code. I thought it was going to compile once I fixed it but got a "cannot implicitly convert "bool" to "double" on this line

              double DesiredValue2 = (Value[0] = High[0] > max[1] && Close[0] < Close[1]) ? 1: 0;

              Thanks for any help, I am very rusty coming back to trading after 5 years...

              Comment


                #8
                Hello reedstickets,

                Thanks for your reply.

                You have a lot going on with that one line and it doesn't make sense as is.
                Can you clarify what you are trying to do? If this is a conversion you may want to double check the source line.

                Comment


                  #9
                  Thanks fr the help Paul,

                  I got it to compile and plot correct. I left the "Value[0] In the line.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  599 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  344 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  558 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  557 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X