pine script variable value problem

Author: Laos and Laos, Created: 2022-09-28 17:03:13, Updated: 2022-09-29 10:57:24

imgThe CodeimgRunning the logs

The first two values in the runtime log are correct, the last one is a bit weird, and this problem occurs with var or varip.


More

The Little DreamHello, the current mechanism is the same as in the trading view: /upload/asset/16a2d340c61bdc64a313.png This is a list of all the different ways Upload/asset/16a2d340c61bdc64a313.png is credited in the database.

The Little DreamYou don't write the plot function in if. The Pine language standard doesn't allow it, but FMZ doesn't require it that strictly.

The Little DreamClear the browser cache completely, log in again, try again, it should be a browser cache problem.

Laos and LaosI'm not going to lie to you.

The Little Dream /upload/asset/1794e2e99995f376e3f6.png

The Little Dream ``` /*backtest start: 2022-08-27 00:00:00 end: 2022-09-26 00:00:00 period: 15m basePeriod: 5m exchanges: [{"eid":"Binance","currency":"ETH_USDT"}] */ varip abc = 0.0 if bar_index % 3 == 0 abc := open plot(abc[0], overlay=true,color=color.red) plot(abc[1], overlay=true,color=color.blue) plot(abc[2], overlay=true,color=color.black) plot(abc[3], overlay=true,color=color.gray) ```

Laos and LaosI switched to the edge browser, cleared the cache and logged back in, still the same. The purchase address is: https://www.fmz.com/m/s/384344 The name of the company is 2c10ab928be48ff44cf0a8fbf6763dcc. I rented this test, you run it.

The Little DreamClear the browser, then log in again to see if it's a browser cache problem. Same code, I'm testing normal here.

Laos and LaosThis is my code /upload/asset/1b4d4a2e2bc2a5b93dc26.png

Laos and Laos /*backtest start: 2022-08-27 00:00:00 end: 2022-09-26 00:00:00 period: 15m basePeriod: 5m exchanges: [{"eid":"Binance","currency":"ETH_USDT"}] */ varip abc = 0.0 if bar_index % 3 == 0 abc := open plot(abc[0], overlay=true,color=color.red) plot(abc[1], overlay=true,color=color.blue) plot(abc[2], overlay=true,color=color.black) plot(abc[3], overlay=true,color=color.gray) /upload/asset/1b54270391946bc2db0c6.png

The Little Dream/upload/asset/1659523137e38c764f4b.png This is a list of all the different ways Upload/asset/1659523137e38c764f4b.png is credited in the database. No, the screenshot runs on FMZ, you can see it here.

Laos and LaosIf you put your test code on fmz and you end up with only two roots, think about my test results, except the first and second outputs are not the same and everything is the same afterwards.