Yes, BBands returns rRealUpperBand, so your code is correct, and as I see it you also get correctly twice the deviation in your example.