简体   繁体   中英

PineScript Variables Intermittent Vales during candle making

I have a question regarding variables value during pine script execution.

Below picture shows a scenario on a five minute chart. In the first candle 11.00 am, the close price is 9200. New candle starts at 11.05 am and this candle is in making. Initially the price is 9100 and then changes to 8900, 9150, 9500 and 9300.

Inside the pinescript script there is a boolean "var lessthan9K" which stores the latest value. This variable is set to true if value goes less than 9000. This value remains true till other condition is met - Greater than 10000. It becomes false when value goes above 10000.

When new candle is in making and when price goes to 8900 at 11.06 am, lessthan9k variable becomes true. My question is whether this value remains true end of the candle when final close price is 9300 @ 11.09 am or it resets to false?

Basically how does it work? During the candle making, any intermittent values are stored or lost (from 1 to 5)?

Thanks

在此处输入图像描述

What you call intermittent values are lost because of the rollback process in the realtime bar. See the usrman's Calculation based on realtime bars section for an explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM