Hello All,

I am pretty new to python and algo trading, however, I have been trading for some time based on TA.

I did not realize it will be such a steep learning path and converting simple strategies to working algo strategies. However, I am thankful for this platform, so that there is a nice way to learn algo trading.

So I started learning python some 3 weeks ago and wanted to implement a simple strategy.

  1. Strategy - 
    1. RSI based buy and sell
    2. if RSI crosses 30 mark on a daily basis -  BUY (from low to high)
    3. if RSI crosses 70 mark on a daily basis - SELL (from high to low)
  2. Liquidate
    1. When BUY order RSI more than 50 mark
    2. When SELL order RSI less than 50 mark
    3. When LOSS on a position is 5% Close it
My backtesting is attached Now QUESTIONS -
  1. How can I add SPY benchmark in the same chart as Equity chart?
  2. After algo stops on end date, I still have holdings. How can I liquidate all after end date is reached?
  3. What should I check next to improve this or any strategy, once I have started doing basic order placement and liquidating?
THANK you in advance for your help. Ray