Detrending in basic new keynesian model

Hello,
I would like to learn how to detrend variables using Dynare for automatic detrending. In my code, when I add two equations for two aggregate prices I get non-stationary form, at least for these two variables.
What kind of deflator should I put in the code, for which variables and in what kind of form - trend or log_trend?
I saw the example in the Dynare User Guide, but it would be easier for me to learn with the model I am well familiarized.
It would be nice if somebody looked at my codes or presented how to detrend variables in some model similar to the basic new keynesian model.
I attach codes.bnk_nonstationary.dyn (2.0 KB)
bnk_nonstationary_steadystate.m (1.5 KB)

Hi, I don’t understand what you are trying to do. Having the price level in your model introduces a unit root, but not a trend per se. For the present mod-file, you don’t need to detrend anything. See also https://github.com/JohannesPfeifer/DSGE_mod/tree/master/Gali_2015

Hi, thank you for your response and for the files. It’s very helpful.