Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show Global Drawing Objects Button Code

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

    Show Global Drawing Objects Button Code

    I have the following code that works to toggle the show global drawing objects from true to false and from false to true. However, it only works for all future drawing objects instead actually turning off and on current global drawn objects. For example if you have a vertical line drawn on a chart and attach to all charts.....I then have another chart with show global objects set to false. I click this button with the assigned code below and it will change the show global objects to true as intended but the global drawn object does not show up. If you then draw a new globally drawn object it will show on the chart but no historically drawn objects will.

    If you go through the data series menu and change the show global draw objects back and forth between true and false and click OK or Apply the global drawing objects will appear and disappear as intended. For some reason the button click isn't working like this. The button click is only changing from true to false or false to true but seems to not be the same as manually changing in the data series menu and clicking apply or ok. Is it possible to do the same think as clicking apply or ok on my custom button clicking event? Is there something I can do to the code to make it do the same thing as using the data series show global objects?

    Here is the button click event code I am using:

    private void btnGlobal_Click(object sender, EventArgs e)//includes toggle function with logic below for markers
    {
    if (ShowGlobal == true)
    {
    ChartControl.BarsArray[0].BarsData.ShowGlobalDrawObjects = true;
    ShowGlobal = false;

    }
    else if (ShowGlobal == false)
    {
    ChartControl.BarsArray[0].BarsData.ShowGlobalDrawObjects = false;
    ShowGlobal = true;


    }
    }

    Thank you.

    #2
    jhowinvest, unfortunately this would be out of the scope we can offer support for here. I'll leave this thread open though for other members of the community to share their thoughts.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Okay. Thank you.

      If anyone else has any suggestions please reply.

      Comment


        #4
        Originally posted by jhowinvest View Post
        Okay. Thank you.

        If anyone else has any suggestions please reply.
        The problem is still not solved. whether there is a solution on how to solve? Please help.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by unpronounceable1700, 10-12-2024, 03:53 PM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by fingers, 10-12-2024, 06:01 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by mtamaku, 10-12-2024, 09:44 AM
        1 response
        21 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by alchippe441, Today, 07:19 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by gig618, Yesterday, 10:34 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X