I'd like to plot on my chart, the number of renko bars that have taken place over the past X minutes.
This would update at the close of each new bar.
I believe MC can do this, but cannot find the right set of functions that will enable me to do this.
I would appreicate if support or someone with the know how, can help guide me in the right direction please.
Thanks
Plot numberof renko bars per time period
Re: Plot numberof renko bars per time period
Just to clarify. I'm only after a single number being plotted on the chart in some predefined location.
But it would also be interesting to plot a continuous indicator line to see how much it can vary.
I know back in March 2020, the number of renko bars being plotted, of any size, compared to normal, just went through the roof.
But it would also be interesting to plot a continuous indicator line to see how much it can vary.
I know back in March 2020, the number of renko bars being plotted, of any size, compared to normal, just went through the roof.
Re: Plot numberof renko bars per time period
inputs:
Price (Close),
Length (14);
variables:
Renko_Time (0),
MyTime (0),
MyPlot (0),
OldTime ( 0 ),
NewTime (0),
TimeInterval ( 0 ),
MyAvg ( 0 ),
MinutesBetween(0);
OldTime = DateTime[1];
NewTime = DateTime;
TimeInterval =NewTime - OldTime;
MyAvg = AverageFC( TimeInterval, Length ) ;
plot1 (MyAvg, "Renko Time");
Price (Close),
Length (14);
variables:
Renko_Time (0),
MyTime (0),
MyPlot (0),
OldTime ( 0 ),
NewTime (0),
TimeInterval ( 0 ),
MyAvg ( 0 ),
MinutesBetween(0);
OldTime = DateTime[1];
NewTime = DateTime;
TimeInterval =NewTime - OldTime;
MyAvg = AverageFC( TimeInterval, Length ) ;
plot1 (MyAvg, "Renko Time");
Re: Plot numberof renko bars per time period
Awesome stuff Thank you....now I am just trying to work out what it is plotting.
The 'close' isn't needed, and had no impact, so I deleted that.
I changed the average to "1" for now, so I can see specifically the value on each bar.
Now, 'DateTime' will be some large value, but you are comparing it to the prior bars DateTime. Is that right?
This isn't what I seek.
I wanted to know, for example, how many renko bars plotted in the past 60 minutes, updated each bar.
Currently when I plot your indicator, it plots a very tiny value of ~0 to.02.
On the RTY 40-20-20 renko chart I am looking at now, the numbers should be in the 10-20 region I think.
Im actually plottig flex renko, but that shouldn't make a difference compared to regular renko.
What I'm expecting to see in the code, is a counter, currenttime and the time X minutes ago.
But there are so many different time functions, my brain goes to mush
The 'close' isn't needed, and had no impact, so I deleted that.
I changed the average to "1" for now, so I can see specifically the value on each bar.
Now, 'DateTime' will be some large value, but you are comparing it to the prior bars DateTime. Is that right?
This isn't what I seek.
I wanted to know, for example, how many renko bars plotted in the past 60 minutes, updated each bar.
Currently when I plot your indicator, it plots a very tiny value of ~0 to.02.
On the RTY 40-20-20 renko chart I am looking at now, the numbers should be in the 10-20 region I think.
Im actually plottig flex renko, but that shouldn't make a difference compared to regular renko.
What I'm expecting to see in the code, is a counter, currenttime and the time X minutes ago.
But there are so many different time functions, my brain goes to mush
Re: Plot numberof renko bars per time period
MC does not correctly deal with Data2 when it comes to Renko bars.
I'd rather not go there at all.
And frankly can't possibly see why it is needed.
How hard can it be to reference X minutes ago, then count the bars?
We do it all the time when using such functions as HighestBar or LowestBar to count the number of bars since an event.
I'd rather not go there at all.
And frankly can't possibly see why it is needed.
How hard can it be to reference X minutes ago, then count the bars?
We do it all the time when using such functions as HighestBar or LowestBar to count the number of bars since an event.
Re: Plot numberof renko bars per time period
Well Dude, you just need to compute the time difference going back in time. Of course, this is trivial for time bars, but not so for Renko, Range, Tick, Volume bars. Always remember that DateTime is a double precision floating point value accurate to the millisecond.
Code: Select all
Input:
iSecondsAgo(numericsimple)
, oActualSeconds(numericRef)
;
Vars:
vIX(0)
, vDeltaSecs(0)
, vMax(1000)
;
vIX = 0;
vDeltaSecs = 0;
While vDeltaSecs < iSecondsAgo
Begin
vIX = vIX + 1;
vDeltaSecs = _szDateSecondsDifference(DateTime[vIX],DateTime);
if vDeltaSecs >= iSecondsAgo and vIX < vMax Then
Break;
End;
oActualSeconds = vDeltaSecs;
_szDateSecondsBarsAgo = Iff(vIX < vMax, vIX, 0);