• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 fx.practic, Today, 05:15 AM
        0 responses
        3 views
        0 likes
        Last Post fx.practic  
        Started by guidoisot, Today, 05:03 AM
        0 responses
        2 views
        0 likes
        Last Post guidoisot  
        Started by Simon Investimens, Today, 03:26 AM
        0 responses
        3 views
        0 likes
        Last Post Simon Investimens  
        Started by EnveousColnago, Yesterday, 06:58 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by owreivmatot, Today, 01:38 AM
        0 responses
        1 view
        0 likes
        Last Post owreivmatot  
        Working...
        X