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 designer01, 03-03-2022, 04:36 PM
    2 responses
    193 views
    0 likes
    Last Post DerkWehler  
    Started by frenchFlorent, Yesterday, 11:26 AM
    4 responses
    14 views
    0 likes
    Last Post frenchFlorent  
    Started by jevillanueva7, 05-08-2023, 09:36 AM
    12 responses
    198 views
    0 likes
    Last Post jeronymite  
    Started by franatas, 02-23-2024, 02:01 AM
    2 responses
    14 views
    0 likes
    Last Post franatas  
    Started by eltonany, Today, 01:56 AM
    0 responses
    3 views
    0 likes
    Last Post eltonany  
    Working...
    X