Forecast Prediction : Custom metric evaluation

Hi All- How are you guys using the evalution metric “NWRMSE” for models ? For example in xgboost model has anyone created a custom NWRMSE evalution function for the model to converge ? If yes would you mind giving a hint how to write that code(I am stuck on how to use Xvars in custom eval function )? -

Or is everyone simply using rmse for the models to converge ?

Update if this helps anyone : A workaround is declaring the TrainDF as a global variable and using it in xgb’s custom eval function. The drawback is that we cannot use it for eval /oof DF so we cannot use it for early stopping rounds.