If you get an ERROR message when using tradescript codes on the Zerodha Pi Scanner, it is because you are not using it the proper way.
Follow the below checklist to learn how to make it work correctly.
1. Errors due to multiple lines of code getting merged as one continuous line when copy pasting codes.
When you copy and paste codes to your Pi Scanner, there is a possibility that formatting errors can occur on some computers.
Different lines of code get merged as one continuous line when pasting codes.
If multiple lines of code are merged without a space in between, the Zerodha pi scanner will generate error.
99% OF SCANNER ERROR HAPPENS JUST BECAUSE OF THIS.
Solution: Make sure there is a one character space after the AND condition and after each line of your pasted tradescript code.
2. Not assigning sufficient backfill data value on the Pi scanner settings.
When setting scanning parameters, always include sufficient backfill data under the “DAYS dropdown menu” on the pi scanner setting .
Ideally set this to 5 DAYS of backfill data when using simple intraday scanner functions like rsi, macd, etc.
Increase this value if required, for example, if you are using a 200 Moving Average condition for 1 hour candle scanning, you obviously will need more than 5 days of backfill.
3. Using more than 1 SET function in your TradeScript code.
The Pi scanner currently accepts only one SET function in any one strategy. If you use more than 1 line of SET condition the scanner will output error messages.
Solution: If you have a strategy with more than one SET function, combine them using brackets.
4. Trying to use the Pi scanner while the markets are shut.
The Zerodha Pi Scanner is a realtime market scanner. It is designed to work only during the trading hours.
Pi scanner do not work while the markets are shut.
5. Not knowing how to identify Pi scanner alerts.
The Pi Scanner do not produce sound alerts, do not generate pop ups or do not log entries to the Generated Alerts Tab.
To identify scanner alerts you need to watch for the ALERT TIME column on your scanner window to highlight in YELLOW.
The “Alert Time Cell” will be highlighted in YELLOW when a match is available for the conditions you are using.
6. The Pi scanner backend server might be having a bad day.
Your Pi scanner signals are processed at the Pi’s cloud server and then passed on to your platform. So everything depends on how good the backend server is performing and the computing resources available on it.
Related to Zerodha Pi Backtest tool.
7. Forgetting to enter the EXIT LONG condition on the backtest engine.
When using the Zerodha Pi back-test engine, Have you forgotten to enter an EXIT LONG SCRIPT while back testing your BUY SCRIPT?
Solution: Use this code on the EXIT LONG SCRIPT TAB to rectify the error. CLOSE < OPEN
8. Insufficient backtest data or using the wrong time frame settings when backtesting strategies.
Error messages for “SCRIPT GENERATED NO TRADES” on backtest engine, recheck if your strategy is practical on the current time-frame and the backfill data is sufficient to work on the tradescript conditions you have framed.
Solution: Test your strategy across different time-frames and increase backtest periods if necessary.
9. Trying to backtest short sell strategies on Pi backtest tool.
The SELL SCRIPT TAB and EXIT SHORT SCRIPT on the back-test engine does not work.
Due to this bug, you cannot backtest shortsell strategies on the backtest engine, so leave it alone.