Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reconstruct 1 tick

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

    Reconstruct 1 tick

    Hi,

    I was looking to reconstruct a 1 tick chart with VOL indicator. If the VOL of the current bar is grater than 5 hold that value and keep adding if the values are grater than 5 until. For example:

    tick1 - 7
    tick2 - 5
    tick3 - 10
    tick4 - 4

    the sum of the above should be 22 because it’s calculating anything above 5.

    Would something like the below work:

    if (VOL[0] >= 5)
    {
    largevolume++;
    Print …. +largevolume;
    }
    else if (VOL[0] < 5)
    {
    largevolume = 0;
    }

    #2
    Hello AgriTrdr,

    Thank you for your post.

    From the code provided, it looks like it should perform what you are describing.

    If the current value of the VOL indicator is greater than or equal to 5, it will increment your largevolume variable.
    Else if the current value of VOL is less than 5, largevolume is reset to 0.

    Just as a heads up, our support generally can't answer questions like "does this look right", we would redirect you to try the script and make sure it does what you asked of it. Testing the script is a very important part of the strategy creation process so that squarely falls on the developer to make sure it works as planned.

    If you have tested the script out and it does not working as you're expecting, we can assist you in the debugging process.

    If you need further assistance please let us know.

    Comment


      #3
      Hi Gaby,

      thanks for your response. I tested the above and I realize what it’s doing is that it’s acting as a “counter” rather than summing the values of VOL indicator. So every time the VOL is above 5, until it goes below 5, it’ll print and let me know how many times the VOL was above 5. How would I get the sum of the VOL?

      Thanks

      Comment


        #4
        Hello AgriTrdr,

        largevolume++ will just increment this variable by 1. If you want to add the the current value of the VOL indicator to largevolume, you would need to do something like this:

        Code:
        largevolume = largevolume + VOL[0];

        or

        Code:
        largevolume += VOL[0];
        Please let us know if you have any further questions.

        Comment


          #5
          Thank you! It's working exactly how I wanted it to.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          607 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          353 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X