Morning to all

In this opportunity I´m looking for any help that anyone may provide me. I´m looking for code samples or github repositories that allow me to find some guides and be able to create a backtesting system that has: 

  1. A trading logic that allow entry and closing points base on conditions and not in a automatically way. By automatically way I mean closing short trades by opening long trades and therefore having trades open all the time.
  2. Provides a trailing stop that follows price movement.

 

Any ideas, comments, where to look for, videos or anything I will be more than grateful!!!!