Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing Chart Button Background based on OnBarUpdate event

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

    Changing Chart Button Background based on OnBarUpdate event

    Is this even possible? If so, would you give me a general direction?

    I've tried

    if (condition == true)
    { one set of chart button specs)
    else
    { a different set of chart button specs}

    but that doesn't seem to do the trick.

    Or should I be applying the conditions to ForceRefresh() only?

    Just asking before I potentially waste more time on this. Thanks.


    #2
    Hello,

    Thanks for your post.

    Yes, it is possible using a dispatcher in the OnBarUpDate().

    I've created an example from the longshorttoolbar strategy. I removed the OBU code and added code to set the background of the "Long" button to be green when the bar is Up and red when the bar is down.

    ButtonBackgroundChangeExample.zip

    Comment


      #3
      That look sensible. Thank you!

      Comment


        #4
        Like a charm. Thanks again. Indeed, THAT's what I call "technical support."

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        96 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        23 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        34 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        34 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X