• 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

[DrawingTool] How to determine method of reaching State.Terminated?

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

    [DrawingTool] How to determine method of reaching State.Terminated?

    hello,

    Does anybody know how to tell the difference in how a drawing reaches State.Terminated?

    I'm trying to check if my custom drawingtool reaches Terminated state when a drawing is deleted/removed, as opposed to reaching State.Terminated via reloading ninjascript.


    Thanks!
    TG

    #2
    Hello gubbar924,

    I’m not seeing a simple way to check this.

    What are you trying to do in State.Terminated that you need to know the difference?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by gubbar924 View Post
      Does anybody know how to tell the difference in how a drawing reaches State.Terminated?

      1.) Declare and set private bool in your drawing tool to false..
      private bool b_ConfigSet = false;

      2.) In State.Configure set bool true.. (this only runs once)
      b_ConfigSet = true;

      3.) In State.Terminated use bool as Condition.. (only print if configured)
      if(b_ConfigSet) Print("Something");



      -=Edge=-
      NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

      Comment


        #4
        @-=Edge=-
        Thank you, I had forgotten about using a variable for state checking, I'll give that a go.

        @NinjaTrader_AlanP
        I dont need to do anything specific with it, I was just wondering if there was a way to run some code only if/when the script/item is being removed from the chart.


        thanks guys!

        Comment


          #5
          Hello gubbar924,

          There would be no supported method however I will submit a feature request.

          I'm curious to know if you were able to get edges suggestion to work.

          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            I have not yet tried it on a drawingtool, but it had worked successfully in the past for me (on an indicator script)

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TazoTodua, Today, 12:52 PM
            0 responses
            1 view
            0 likes
            Last Post TazoTodua  
            Started by Bluebeep, Today, 12:26 PM
            0 responses
            3 views
            0 likes
            Last Post Bluebeep  
            Started by Johnny90, Today, 12:12 PM
            0 responses
            1 view
            0 likes
            Last Post Johnny90  
            Started by login_dejavu, Today, 10:55 AM
            0 responses
            5 views
            0 likes
            Last Post login_dejavu  
            Started by learningnt, Today, 08:47 AM
            0 responses
            206 views
            0 likes
            Last Post learningnt  
            Working...
            X