Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieve Data from Screen (or Drawing Objects box)

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

    #16
    Hello,

    Thank you for your reply.

    It will automatically find the new drawing object the next day after it's drawn on the chart and continue working. If you don't check that the date of the rectangle object matches the date of the current bar, you won't get the values for the correct date for the bar.

    Please let us know if we may be of further assistance to you.

    Comment


      #17
      Thanks for your reply,Kate,
      1.For example, my strategy capture the rectangle in the period of 22:30 to 23:00, would the StartY values still be valid after 00:00?
      2. If I disable and enable the strategy after 00:00 , will be StartY disappear and no values for StartY?
      Any suggestion to solve the problem that the values disappear after turn on and off for the strategy after 00:00 as my trading time would always be 22:30 to 05:00 of next day
      Last edited by stantenlee; 02-11-2022, 03:35 PM.

      Comment


        #18
        Hello stantenlee,

        Thank you for your reply.

        It keeps the last available prices for the StartY and EndY until the next rectangle is drawn. If you disable the strategy and reenable it it will use the prior day's rectangle values until that day's rectangle is drawn.

        Please let us know if we may be of further assistance to you.

        Comment


          #19
          Hi Kate,thanks

          But I found it print many zero values after I disable and re-enabled the strategy like the figure attached.

          Click image for larger version

Name:	IMG_3488.jpg
Views:	175
Size:	1,020.2 KB
ID:	1189666

          Comment


            #20
            It would just print the required data Start Y and EndY if I turn on and off the whole Ninjatrader PlatformClick image for larger version

Name:	IMG_3489.jpg
Views:	165
Size:	96.1 KB
ID:	1189668

            Comment


              #21
              Originally posted by stantenlee View Post
              Thanks for your reply,Kate,
              1.For example, my strategy capture the rectangle in the period of 22:30 to 23:00, would the StartY values still be valid after 00:00?
              2. If I disable and enable the strategy after 00:00 , will be StartY disappear and no values for StartY?
              Any suggestion to solve the problem that the values disappear after turn on and off for the strategy after 00:00 as my trading time would always be 22:30 to 05:00 of next day


              if (temp.StartAnchor.Time.Date == Time[0].Date ||temp.StartAnchor.Time.Date == Time[-1].Date)
              {
              StartY = temp.StartAnchor.Price;
              EndY = temp.EndAnchor.Price;
              Print("StartY : " + StartY + " EndY: " + EndY + "in loop");

              }
              i trid this but seems not working

              Comment


                #22
                Hello stantenlee,

                Thank you for your reply.

                I'm not seeing my example script have 0 values for StartY and EndY when the Strategy is restarted after midnight, it still simply will use the values from the most recent rectangle. I suspect you've got something in your logic causing this. Can you supply an export of your current script?

                Thanks in advance; I look forward to assisting you further.

                Comment


                  #23
                  I found the problem that causing this, it happens once the code was updated and compiled followed by re-enabled the strategy.It would make startY and EndY to be zero. I need to cloase the whole ninjatrader and enabled the strategy , it get back the normal StartY and EndY values. Does it mean we cannot re-compile in live to make the strategy updated?I need close whole program and open again to get it updated and get the values?

                  Comment


                    #24
                    Hello stantenlee,

                    Thank you for your reply.

                    When you make changes and compile a script, it is best practice to remove it from the chart completely and re-add a new instance of the indicator or strategy. This is because not all changes to the script can be picked up simply by refreshing NinjaScript. You should always make sure to remove and re-add the script to the chart after making changes - a complete restart of NinjaTrader is not necessary.

                    Please let us know if we may be of further assistance to you.

                    Comment


                      #25
                      thanks Kate

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by NullPointStrategies, Today, 05:17 AM
                      0 responses
                      48 views
                      0 likes
                      Last Post NullPointStrategies  
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      126 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      66 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      42 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      46 views
                      0 likes
                      Last Post TheRealMorford  
                      Working...
                      X