Hello boatman,
Thank you! Not so hard after all :o)
Yes, i get the peak-valley code, done it plenty in MT4.
When having your attention. You don't happen to have a good example of how to set up and plot Tick-data?
Here is a working Renko example if someone is interested:
// Renko bars, variant 2 in the manual
int bar(vars Open, vars High, vars Low, vars Close)
{
var BarRange = 0.0030;
var OpenDiff;
var CloseDiff;
OpenDiff = abs(Close[0]-Open[1]);
CloseDiff = abs(Close[0]-Close[1]);
if(OpenDiff < CloseDiff) {
// If this matches we have a valley or peak
Open[0] = Open[1];
} else {
// This is for when we are moving with the trend
Open[0] = round(Close[1],BarRange);
}
if(Close[0]-Open[0] >= BarRange) { // Going up
Close[0] = Open[0]+BarRange;
High[0] = Close[0];
Low[0] = Open[0];
return 1;
}
if(Open[0]-Close[0] >= BarRange) { // Going Down
Close[0] = Open[0]-BarRange;
High[0] = Open[0];
Low[0] = Close[0];
return 1;
}
return 4;
}
function run()
{
set(PLOTNOW);
StartDate = 2006;
BarPeriod = 60;
MaxBars = 400;
//* Plot Parameters
PlotScale = 8;
PlotWidth = 10000;
PlotHeight1 = 500;
PlotHeight2 = 200;
vars Open = series(priceOpen());
vars High = series(priceHigh());
vars Low = series(priceLow());
vars Close = series(priceClose());
vars Price = series(price());
ColorUp = BLUE;
ColorDn = MAGENTA;
}