Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rgb Rendring Will not Work for 1-Minute Charts

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

    Rgb Rendring Will not Work for 1-Minute Charts

    Dear Support,

    I am using the following RGB format for variable rendering:

    Code:
     Brush myBrush = new SolidColorBrush(Color.FromRgb(Convert.ToByte(var1), Convert.ToByte(var2), Convert.ToByte(var3)));
    The above "var" parameters are calculated as integers and range between 0-255.

    The indicator works perfect for any size tick charts. However, in some cases it will not draw for small minute (1m, 2m, etc) charts and some other bar types and an error is reported in the log window:

    Indicator "": Error on calling 'OnBarUpdate method on bar #: Value was either too large or too small for unsigned byte.

    What is "unsigned byte"? Can you please help with interpretation of this error? Any alternative code snippets for defining myBrush without having to convert to byte for NT8?

    Note: The above code without Convert to Byte worked fine for NT7, but not for NT8.

    Many thanks.

    #2
    Hello,

    Thank you for the post.

    I wouldn't be sure of why the error happened without having printed the values being passed in. I also wouldn't be sure of the difference between 7 and 8 without that test. Based on the details it sounds like in some cases the value is not as expected when it reaches this point.

    I would suggest doing that test and print the values to know why the error may be happening with this specific syntax/logic being used. It would be a guess as to why the error happened related to this syntax other than the value was incorrect to be converted to a byte.

    You could also try simplifying the syntax to just use the ints instead of doing a byte conversion as you noted you are using an int 0-255:

    Code:
    Brush myBrush = new SolidColorBrush(Color.FromRgb(255,0,255));
    
    Brush myBrush = new SolidColorBrush(Color.FromRgb(var1,var2,var3));


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by PaulMohn, Today, 03:49 AM
    0 responses
    6 views
    0 likes
    Last Post PaulMohn  
    Started by inanazsocial, Today, 01:15 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    10 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    4 views
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Working...
    X