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

Quick change bool for indicator without going into properties?

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

    Quick change bool for indicator without going into properties?

    Hi,

    I have built an indicator to assist me in day trading and it has heaps of levels which it adds to the chart. I need to turn these levels on and off depending on whether they are relevant to me at the time and it is time consuming using a bool and going into chart properties every time to turn them on and off.

    Is there a way to add check boxes to the chart/indicator window that I can click on and off which controls a bool? Or maybe a work around of some sort that anyone can suggest?

    I know that some professional software distributors have added options to the right click menu but i assume this is too complex for a hobby programmer.



    Thanks in advance for any suggestions.

    Cheers

    Marty

    #2
    Hi Marty,

    Thank you for your post.

    This does fall into the unsupported territory and would not be able to offer full assistance.

    However, you may want to look at a script below that one of our users developed that adds buttons to the chart.

    http://www.ninjatrader.com/support/f...d=5&linkid=490

    Additionally, here is a link on an outside article on creating custom buttons -
    http://stackoverflow.com/questions/1...button-control

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the suggestions Cal.

      The first one looked promising. I used the code and spent the day creating 14 buttons which worked perfectly offline. Then the strangest thing happened when I went live, I had all sorts of crazy things happening with my drawing objects. The indicator started up a new and invisible instance of itself every time the chart refreshed / tick event. Each instance wont even stop running in the background once you delete the indicator from the chart. You actually have to close the chart window to stop it running all the instances of the indicator..... Crazy to see in the output widnow when there are a few "Prints" throughout your indi.

      So a warning to anyone thinking of trying this out, you are opening a can of worms, unless you are more experienced than I of course.

      Thanks for the suggestions though, I think i should stay within the gated garden of Ninja Traders support area!

      Comment


        #4
        ACTUALLY!

        after a bit of searching it turns out that it was the DISPOSE() method that was calling all the bugs!

        if anyone wants to use the above linked coded you need to replace the...

        public override void Dispose()
        {
        }

        WITH

        protected override void OnTermination()
        {

        }

        Thanks Cal, working great now!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by martin70, 03-24-2023, 04:58 AM
        15 responses
        114 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by The_Sec, Today, 02:29 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by jeronymite, 04-12-2024, 04:26 PM
        2 responses
        31 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Mindset, 05-06-2023, 09:03 PM
        10 responses
        265 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by michi08, 10-05-2018, 09:31 AM
        5 responses
        743 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X