Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to figure out the CustomSamplePlot

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

    Trying to figure out the CustomSamplePlot

    In the attachment "Right Side Rectangle" is a picture of the code I'm attempting to write. It is a rectangle on the right side that represents the recent highs and lows of an indicator. This rectangle will be centered at zero and the highs and lows will follow the indicator.

    In the attachment "Right Side Rectangle Attempt#1 you can see the red rectangle below the zero line.

    In this line of code:
    Rectangle rect = new Rectangle(X,Y, 23,54);

    For "Y" I'm using:

    int Y = (bounds.Y + bounds.Height) - ((int) ((( 0 - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height))-1;

    Which seems to work good and gives me the zero reference.

    But for the height term, I'm currently inserting 54 which is approximately the correct value. This is not the correct term as it is only a fixed value.

    But before I can determine the algorithmic term for the height I need to first understand why when I use a negative term, it does not plot a rectangle. Example, if I use -54, no rectangle appears.

    I'm still very confused on how to best get the Y and the Height terms to dynamically plot the rectangles.

    regards,
    taddypole...
    Attached Files

    #2
    I think I can answer my own question.
    If X & Y designate the upper left of the rectangle, width and height can only be positive as a relative position. Specifying a negative value for width or height will place those points outside the boundaries of the rectangle. Once I accepted this and figured out the algorithm for the rectangle width and height, all is now working.

    regards,
    taddypole...

    Comment

    Latest Posts

    Collapse

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