ups sorry, I copied the code in and changed the start and end date afterwards, my bad.
of course I included the entire historical data set I have in my history folder, by setting startdate to 20020101 and no enddate.

Edit: Thanks for the hint with the Lookback, though. Setting it to 0 makes the starting point equal, but the enddates still diverge slightly.

See script and output below:

function run()
{
set(PLOTNOW);
StartDate = 20020101;
BarPeriod = 1440;
LookBack = 0;

NumTotalCycles = 5;
Detrend = SHUFFLE;

PlotWidth = 1200;
PlotHeight1 = 600;
ColorUp = ColorDn = 0;
plot(strf("#Cycle_%d", TotalCycle), priceClose(), MAIN, color(100*TotalCycle/NumTotalCycles, BLUE, RED, GREEN));
}

Attached Files test_EURUSD.png
Last edited by gamadeus; 12/18/18 22:10.