Altitude loss while pitching up and pitch down in both loiter and Autonomous mode

I’m using 4.4.4 firmware, i have this altitude loss in both loiter and Auto flight mode while moving forward and backward.
i thought it was due to RADAR but when i replaced cube with K++ V2, i didn’t get any loss of altitude. But I’m unable to extract parameters from k++, so can anybody help out with parameters to solve this altitude loss issue.