-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Test case:
//@version=6
indicator("initVar issue", overlay=true)
var ph_time = time[15]
log.info("{0}", ph_time)ph_time will be NaN instead of time of bar at previous 15.
It seems some logic wrong at:
Lines 543 to 549 in ad26f8d
| initVar(trg, src: any): Series { | |
| // If target exists (subsequent bars), return it as is. | |
| // PineTS automatically shifts context variables by copying the last value, | |
| // so the previous value is already carried over to the current slot. | |
| if (trg) { | |
| return trg; | |
| } |
Where, value will be assigned the first time only, won't be assigned again afterward since trg already inited.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels