I'm trying to program a strategy, to program long and short entries, I wrote the code for long once, and then copy paste the code, and search replace all "Long" to "Short", and all "High" to "Low", etc. But this is not very elegant and could introduce error if I don't eyeball it.
So, is there an elegant "best practice" to program long and short of identical rules?