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 laocoon, Today, 06:26 AM
    0 responses
    8 views
    0 likes
    Last Post laocoon
    by laocoon
     
    Started by Lance El Camino, 02-28-2024, 06:51 PM
    9 responses
    36 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by philmg, Today, 06:21 AM
    0 responses
    6 views
    0 likes
    Last Post philmg
    by philmg
     
    Started by RookieTrader, Today, 06:16 AM
    0 responses
    5 views
    0 likes
    Last Post RookieTrader  
    Started by Tidan2, Today, 05:11 AM
    0 responses
    7 views
    0 likes
    Last Post Tidan2
    by Tidan2
     
    Working...
    X