As I understood the way calculation is done, I decided to forget this. I tried to get the average maximum pips upwards for up candles and downwards for down candles with this script, but the values I'm getting are looking strange:

Code:
function run()
{
	StartDate = 20180101;
	EndDate = 20181231;
	BarPeriod = 1440;

	ccyReset();
	while(asset(loop("AUD/CAD","AUD/CHF","AUD/JPY","AUD/NZD","AUD/USD","CAD/CHF","CAD/JPY",
									"CHF/JPY","EUR/AUD","EUR/CAD","EUR/CHF","EUR/GBP","EUR/JPY","EUR/NZD",
									"EUR/USD","GBP/AUD","GBP/CAD","GBP/CHF","GBP/JPY","GBP/NZD","GBP/USD",
									"NZD/CAD","NZD/CHF","NZD/JPY","NZD/USD","USD/CAD","USD/CHF","USD/JPY"))) 
									
	{
		
		if(priceOpen <  priceClose) ccySet((priceHigh() - priceClose())/PIP);
		if(priceOpen >= priceClose) ccySet((priceClose() - priceLow())/PIP);
	}
	printf("n%d.%d.%d - USD = %.5f", year(),month(),day(),ccyStrength("USD"));
}