if you are trying hedging strategies, my opinion about these is that they are overcomplicated Martingale strategies. The same result, but much, much harder to make and maintain. The easiest thing to do in your case is to just close those buy trades and think fresh what to do next.
If you want to calculate the total lot size of those trades, it's a little bit complicated and it looks something like this: http://prntscr.com/85eof1
http://i.imgur.com/OtO811w.png
For the future I was planning a block that will load a group of trades and then in "Condition" and all the other blocks various parameters will be available, like Average Lots, Total Lots, Min Lots, SL, TP... stuff like that.