Thursday, October 13, 2022

Power of Stocks 5 EMA Strategy with Signals using Loop and Backtest Snippets

 





Based on Power of Stocks 5 EMA Strategy is said in https://youtu.be/uu3zGIXaG8g Buy 15 min , Short 5 min.
  

When Backtesting in Amibroker if same candle hit SL and entry , it counted as zero loss. This strategy get more trades entry and exit in same bar. So i made it backtestable in 1 minute.

It have option to select Stock | Index. For Stock it have separate Entry , Sqoff timing, Quantity is calculated as per Initial Equity divided by Position Size (Amibroker use Compounding in backtest, increase position size when increase in Capital, So limit number of Max Open Positions as per your requirement). for Index it is good to backtest with 1 quantity with out commission as it is mostly trade in options. As per Net Profit in points it can considered as good or not.

Trade Prices BuyPrice, ShortPrice, SellPrice, CoverPrice are used with ValueWhen Entry. It work for some strategies. Most Strategies it will change if next time entry condition valid. So Entry Exit Signals and Price code in loop is required. This AFL Signals are coded in loop and easily learn. Thanks to Yogesh Dalvi (Telegram @dyogesh) helped me to code this loop.