How to make indicator updated only at the first tick of the bar?

 

I created an indicator that calculate Support and Resistant (S/R) everytime new bar created. And this indicator eat my PC resource so much because everytime new tick occurs it calculate the S/R.


Actually i do not need the indicator calculate S/R everytime new tick occur. I only need the indicator updated at the first time new bar created?

What is the right way to do this?


Is it right to use " if (Volume[0]<=1) { //calculate S/R}" ?


Thank you.


Aldhy

 

S

Nearly :)



if (Volume[0]==1)
  {
    // Do any calculations here once per bar, on first tick of bar
 
  }


Good Luck

-BB-

 
BarrowBoy:

S

Nearly :)





Good Luck

-BB-

Thank you BarrowBoy ;)

Reason: