The "current bar", bar index 0, is never complete.
If it is, then it has become bar 1, and a new and incomplete current bar has started.
int intPos, counted_bars=IndicatorCounted();
//----
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- the last counted bar will be recounted
if(counted_bars>0) counted_bars--;
intPos = Bars-counted_bars-1;
while (intPos>=0)
{
if (intPos != 0)
{
//calculate value
}
intPos--
}
Is the above code correct ?
Depending on what is in //calculate value, it might work for you.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
greeting,
Is there a way to check the current bar is fully completed? i would like to calculate an indicator value base on the actual closing of current bar.