Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 20:05:35 +0000



skipped sc.Index processing for ACSIL study?

View Count: 134

[2024-08-06 21:04:05]
User133994 - Posts: 80
Anyone,

I have a custom study that runs on every bar (I've seen the same behavior on manual and auto looping studies).

Example output (look at current values of sc.Index, i.e. currentIndex) on 'normal' bar by bar activity:

Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41937) | 2024-08-06 16:29:35.887
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41938) | 2024-08-06 16:29:37.230
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41939) | 2024-08-06 16:29:56.305
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41940) | 2024-08-06 16:30:06.949
--------------- SKIPPED BARS HERE!! ---------------------
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41944) | 2024-08-06 16:30:11.956
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41945) | 2024-08-06 16:30:13.314
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41946) | 2024-08-06 16:30:16.006
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41947) | 2024-08-06 16:30:17.363
Chart: ESU24_FUT_CME [CV][M] 0.75 Range #1 | Study: bbot_bw v 0.03 | 5527 bbEntryHit false (currentIndex: 41948) | 2024-08-06 16:30:20.053


Do you seek the skipped indexes? 41940 skips 41941, 41942, .. through to 41944 (that is 4 bars of 'info') that is totally IGNORED by the study. I know I'm not the first to see this behaviour. Of course it occurs because of fast bars...all 4 bars paint at the same time, so the study 'skips' processing information (i.e. a signal occurred on 41942) but it didn't register.

When I do a 'full' recalculation these bars aren't skipped...thus a different output shows. Frustrating and unreliable.

Can I process 'skipped' bars inside an ACSIL study? I am sure SC already knows these bars are 'fast' and can mark them as such, so that when I build my custom study around them, I will do so knowing they painted all at once. Thus, I'd like inside ACSIL to be able to process 'normal' bars and 'fast' bars BOTH. Doing a full-recalculation is inefficient and overkill (only need to process the last 4 'fast' bars) for this situation.

Using sc.UpdateAlways won't solve the issue..b/c that is a 'time-based' solution. I need something that is bar-based. For example, a solution that doesn't skip any bars (marking the fast bars would be grand.) Building a custom loop to do this check in my custom study is also unreasonable as I use sc.Index or sc.UpdateStartIndex in all my code...which already SKIPS bars--I'd have to rewrite the entire capability of the SC looping function.


I think I've found the culprit:

if (sc.Index < sc.ArraySize - 1) // Run the below code only on the last bar
return;
Is there a reason that the above code causes this 'skipping' behavior I presented above. Likely, because if 4 bars are added to the ArraySize at the same time then the in-between bars are skipped. Can anyone please confirm this is what is occurring? Or if you have a more elegant solution (or SC built-in function) please let me know.


Thanks in advance!
[2024-08-06 21:42:33]
Sierra_Chart Engineering - Posts: 17150
If the custom study is using manual looping, then you have to iterate through all of the indexes and that is your responsibility.

If a custom study is using automatic looping, there are no skipped indexes. The study function is called for every bar index. It is impossible for there to be skipped indexes.

Remove this code:
if (sc.Index < sc.ArraySize - 1) // Run the below code only on the last bar

return;

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-08-06 21:43:04

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

Login

Login Page - Create Account