Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 03:21:12 +0000



Post From: Calculation Precedence And Auto looping

[2020-05-15 08:22:54]
Flipper - Posts: 65
When a study is using auto looping it seems that the Calculation Precedence does not hold.

I have a study with manual looping doing a calculation and then a second study referencing the first study which is added last on the chart and set to sc.CalculationPrecedence = LOW_PREC_LEVEL
and doing only one calculation per bar. But the second study seems to be calculating first!?


Chart: F.US.HSIK20 10 Sec #1 | Study: Example Reference | STUDY-2 Index: 2165, num: 2164 Subgraph value last Bar: 0.00, Subgraph One Bar ago: 11.00 | 2020-05-15 18:15:34.113
Chart: F.US.HSIK20 10 Sec #1 | Study: Manual Loop Example | STUDY-1 Index: 2165, num: 2165 Subgraph value last Bar: 10.00 | 2020-05-15 18:15:35.114
Chart: F.US.HSIK20 10 Sec #1 | Study: Example Reference | STUDY-2 Index: 2166, num: 2165 Subgraph value last Bar: 0.00, Subgraph One Bar ago: 16.00 | 2020-05-15 18:15:41.622
Chart: F.US.HSIK20 10 Sec #1 | Study: Manual Loop Example | STUDY-1 Index: 2166, num: 2166 Subgraph value last Bar: 1.00 | 2020-05-15 18:15:42.612
Chart: F.US.HSIK20 10 Sec #1 | Study: Example Reference | STUDY-2 Index: 2167, num: 2166 Subgraph value last Bar: 0.00, Subgraph One Bar ago: 2.00 | 2020-05-15 18:15:51.114
Chart: F.US.HSIK20 10 Sec #1 | Study: Manual Loop Example | STUDY-1 Index: 2167, num: 2167 Subgraph value last Bar: 1.00 | 2020-05-15 18:15:52.111

So the second study which is using sc.GetStudyArrayUsingID() and/or sc.GetPersistentIntFromChartStudy() never updates.

If I change the first study to Auto Looping the Calculation Precedence seem to revert back to the expected behavior.


Chart: F.US.HSIK20 10 Sec #1 | Study: Auto Loop Example | STUDY-1 Index: 2183, num: 2183 Subgraph value last Bar: 1.00 | 2020-05-15 18:18:35.583
Chart: F.US.HSIK20 10 Sec #1 | Study: Example Reference | STUDY-2 Index: 2183, num: 2183 Subgraph value last Bar: 1.00, Subgraph One Bar ago: 26.00 | 2020-05-15 18:18:35.583
Chart: F.US.HSIK20 10 Sec #1 | Study: Auto Loop Example | STUDY-1 Index: 2184, num: 2184 Subgraph value last Bar: 2.00 | 2020-05-15 18:18:41.583
Chart: F.US.HSIK20 10 Sec #1 | Study: Example Reference | STUDY-2 Index: 2184, num: 2184 Subgraph value last Bar: 2.00, Subgraph One Bar ago: 3.00 | 2020-05-15 18:18:41.583

Is it expected that auto looping would have this effect?