Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 03:39:30 +0000



[Programming Help] - Problem with indexing in a P&F chart

View Count: 580

[2019-08-25 16:13:41]
User119231 - Posts: 7
Hello

Could you please help me understand the following behaviour?
I am using a P&F 1-12 chart and I am trying to access each bar index with a simple for loop (I am posting the code below).
The problem is:

1) When I load more than 1 day in the chart the sc.Index does not start from 0 but from a random place way after the first bar.
Here I attach the first lines from the Message Log where I have loaded 5 days. The chart has 346 bars and the sc.Index starts
from 283.

Chart: CLU9-NYMEX Point & Figure 1-12 #22 | Study: TEST1 | i 128 ArraySize 347 sc.Index 283 | 2019-08-25 11:21:41.924 *
Chart: CLU9-NYMEX Point & Figure 1-12 #22 | Study: TEST1 | i 129 ArraySize 347 sc.Index 283 | 2019-08-25 11:21:41.924 *
Chart: CLU9-NYMEX Point & Figure 1-12 #22 | Study: TEST1 | i 130 ArraySize 347 sc.Index 283 | 2019-08-25 11:21:41.924 *
Chart: CLU9-NYMEX Point & Figure 1-12 #22 | Study: TEST1 | i 131 ArraySize 347 sc.Index 283 | 2019-08-25 11:21:41.924 *

2) I tried the same code in a time based chart and the platform freeze and then crash each time.


// Section 2 - Do data processing here
  
for (int i = 0; i < sc.Index ; ++i)
{
  SCString ExistingDrawingInfo;
  ExistingDrawingInfo.Format(" i %d ArraySize %i sc.Index %d", i, sc.ArraySize, sc.Index);
  sc.AddMessageToLog(ExistingDrawingInfo, 1);
    
}

* Autoloop has been set to 1

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account