Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Since Plot

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

    Bars Since Plot

    Looking with bar count or bar time to some how compare the most recent plot of an indicator to the previous plot of an indicator

    Swing for example you would have a Swing High - most current and a Swing Low most current

    Looking to create condition if last Swing High was plotted After the Last Swing Low or before the Last Swing Low

    Need some direction of how to approach that

    Thanks

    #2
    Hi, thanks for posting.

    I made this Single Dot Swing indicator in the past that makes the swing indicator a bit easier to work with:



    You may download and import the script to test it. Also, use the Print method to print data from the script to see what code is executing and where. To see what comes first you can use boolean variables to keep track of what the last two swings were.

    Best regards,
    -ChrisL

    Comment


      #3
      I am not actually using a Swing Indicator, but my own version that number them H1 H2 H3 with H1 being most recent, and H2 was the old H1, works great, has L1 L2 L3 as well

      So i Know the H1 was more recent than H2 and I know that L1 was more recent than L2

      but I do not know if H1 was more recent than L1 OR if L1 was more recent than H1 < --- this is my issue to resolve

      I use alot Bool statements but I do not know how to use it in this case, th


      thought of use a double but cant seem to get that to work either, I could be that I do not understand the double well enough

      I was hoping to INDENTIFY A bar number at H1 and bar number at L1

      Comment


        #4
        Hi DTSSTS, thanks for your reply.

        You are identifying the Highs and Lows in some way and ordering them 1-4. It seems the best solution is to save the time stamp of the bar when you are identifying the swings. You can use a Tuple object to save two objects into one:

        C# tuples: lightweight data structures that you can use to group loosely related data elements. Tuples introduce a type that contains multiple public members.

        Comment


          #5
          Thanks, if what I am trying now does not work I will investigate your suggestion. I think the double value and using logic that the current H1 just change on the last bar to toggle the double value might work.

          thanks again

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          56 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          132 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X