Hello!
There is in-built indicator
CUSTOMCANDLE in JForex 4 that implements solution you describe.
https://www.dukascopy.com/downloads/ban ... s/?lang=enPlease press Fn+F3 -> Enter "CUSTOMCANDLE" in search bar and add to chart -> Right click on indicator in the right panel and click "edit" - > Go to advanced settings and choose the type of candles you would like to add.
Please see screenshot in attachment.
Kind regards,
Dukascopy Bank