Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 trueketo, Today, 01:00 AM
        0 responses
        9 views
        0 likes
        Last Post trueketo  
        Started by trueketo, Today, 12:59 AM
        0 responses
        7 views
        0 likes
        Last Post trueketo  
        Started by jeliner, Today, 12:58 AM
        0 responses
        6 views
        0 likes
        Last Post jeliner
        by jeliner
         
        Started by KlockoNell, Yesterday, 11:13 PM
        0 responses
        10 views
        0 likes
        Last Post KlockoNell  
        Started by AyanaMosc, Yesterday, 10:51 PM
        0 responses
        14 views
        0 likes
        Last Post AyanaMosc  
        Working...
        X