I want to use this logic for backtest in python-

If price of AAPL goes above 100$, go long

If price goes below 100$, go short.

Take profit at 1% at each Long/short positions.

Could you please help me with he code? Thanks

Author