# Tradescript backtest results widely different from Chart readings

**URL:** https://tradingqna.com/t/tradescript-backtest-results-widely-different-from-chart-readings/31158
**Category:** Algos, strategies, code
**Created:** [January 15, 2018, 3:59am UTC](https://tradingqna.com/t/tradescript-backtest-results-widely-different-from-chart-readings/31158 "2018-01-15T03:59:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![unknownshri](https://tradingqna.com/user_avatar/tradingqna.com/unknownshri/32/11015_2.png) [@unknownshri](https://tradingqna.com/u/unknownshri)
#### Post date: [January 15, 2018, 3:59am UTC](https://tradingqna.com/t/tradescript-backtest-results-widely-different-from-chart-readings/31158/1 "2018-01-15T03:59:06Z")

</div>

I am new to Tradescript and wanted to create a simple buy script whenever the CLOSE crosses the PSAR (0.02, 0.2). So, I used CROSSOVER (CLOSE, PSAR (0.02, 0.2)). This is for Alumini17JanFut 5-min charts.

The results are very perplexing as they are anomalous.

For instance, the backtest shows me that I should have gone LONG at 21:15:59 (on 12-01-2018) at a particular price. When I see the charts, there is no crossover of Close and PSAR at all!

What am I doing wrong?

Also, is there a way in tradescript to see what values are being fed by various functions/primitives/scripts?  
For instance, I would like to know all PSAR (0.02, 0.2) values for the last one day for a 5-min interval. I want to know this for checking if I am going in the right direction.

---

<div class="post-metadata">

### Author: ![TradingCodes.in](https://tradingqna.com/user_avatar/tradingqna.com/tradingcodes.in/32/5534_2.png) [@TradingCodes.in](https://tradingqna.com/u/TradingCodes.in)
#### Post date: [January 15, 2018, 8:10am UTC](https://tradingqna.com/t/tradescript-backtest-results-widely-different-from-chart-readings/31158/2 "2018-01-15T08:10:34Z")

</div>

> [@unknownshri](#):
>
> What am I doing wrong?

Use the Back-Test Engine on Zerodha Pi ONLY to double check if the Tradescript codes you want to use on Scanner or EA is correct.

The Pi back-test engine has bugs. For precision back-testing use Amibroker.

---

<div class="post-metadata">

### Author: ![unknownshri](https://tradingqna.com/user_avatar/tradingqna.com/unknownshri/32/11015_2.png) [@unknownshri](https://tradingqna.com/u/unknownshri)
#### Post date: [January 15, 2018, 8:12am UTC](https://tradingqna.com/t/tradescript-backtest-results-widely-different-from-chart-readings/31158/3 "2018-01-15T08:12:53Z")

</div>

Ok. Thanks.
