Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Feature Request: Adding “Snap to Extreme” to Fibonacci Retracements Drawing Tool

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

    Feature Request: Adding “Snap to Extreme” to Fibonacci Retracements Drawing Tool

    Hi, I'm transfering my working NT7 indicator to NT8. The indicator will create 2x buttons next to the chart. When click "Fib Up", it will use the most recent 2 completed bar to draw Fibonacci Retrancement up. vici-versal. But I have issue with High[0] and Low[0] that does not reflect the High and Low of the most recent completed bar. When check these two value in OnBarUpdate(), it will reflect correctly. But if check the same High[0] and Low[0] when software enter routine Button_Click(), the High[0] and Low[0] does not reflect the right value. When check the Bars.GetTime, it showed it was looking at bar at Sep instead of today's bar.
    Can anyone advise how to get the righ High & Low of the most recent 3 buttons?


    #2
    Hi chrishyewll, thanks for writing in.

    You will need to use TriggerCustomEvent in the button event to sync the data on the instrument thread with the UI thread. See the documentation here for some examples:



    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks, ChrisL! I will try the method.

      Comment


        #4
        Originally posted by chrishyewll View Post
        Thanks, ChrisL! I will try the method.
        Hi ChrisL, sorry for the late updates. Yes, your advice above worked well. Thanks!

        -Chris

        Comment


          #5
          Now I met a new problem on the same script (migrating from working NT7 to NT8). I use a customized button to start the entry-seeking process in a zone (evaluate inside 'OnBarUpdate'). When it found an entry, it will use ATM to park entry requests. Once parked (before market reach to take out the entry), it will clear the button color and text to show that the request already turned to actual entry request.

          The problem now is that when it tries to change button color (inside routine ClearZoneFlags), the script crash with the error "Error on calling 'OnBarUpdate' method on bar 59561: The calling thread cannot access this object because a different thread owns it." Please see pic below. Any suggestion on how do I able to solve this? Thanks.

          Click image for larger version

Name:	NT8-ButtonColorUpdateError.png
Views:	275
Size:	630.7 KB
ID:	1184854

          Comment


            #6
            Hi, Its the same problem as the issue above. You need to use TriggerCustomEvent to access the buttons on the UI thread.

            Best regards,
            -ChrisL

            Comment


              #7
              Noted, thanks, ChrisL!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              574 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              333 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X