Refactored trade signal generator and added tests
fixing merge commits