Login Page - Create Account

Support Board


Date/Time: Tue, 25 Aug 2026 08:48:06 +0000



Extend Closes Until Future Intersection and Line Until Future Intersection ACSIL Function

View Count: 5838

[2016-10-15 22:58:24]
Sierra Chart Engineering - Posts: 104368
In the latest revision of 1473, there is a new study named Extend Closes Until Future Intersection which extends the closing prices in Intraday charts, according to the Session Times, until future intersection with prices.

This uses a new ACSIL function called sc.AddLineUntilFutureIntersection. This allows this functionality to be applied to any study universally.

The source code can be found in the /ACS_Source folder.

We also added this capability to the Swing High/Low study . There is a new input to extend swings forward until future intersection.

Let us know what other studies you would like this functionality added to and we can do that.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-16 10:38:43]
binaryduke - Posts: 387
Hi SierraChart

This is a great feature and I'm looking forward to using the new ACSIL function.

I've been checking out the feature. It appears that extensions from the last bar of a session do not take into account the first bar of the next session:

http://www.sierrachart.com/image.php?Image=1476613689145.png
The 7 October 2016 13:20 bar closed at 164'29. The subsequent bar traded at this level but the Extend line was only taken out at the 10 October 2016 01:00 bar

http://www.sierrachart.com/image.php?Image=14766140599.png
The 5 October 2016 13:20 bar closed at 165'22. The next bar traded at this price level but the Extend continued until the 6 October 02:00 bar.

EDIT - Have noted your comments about 'according to the session times' and reviewed the code. I can see that this behaviour is intentional within the study.
Date Time Of Last Edit: 2016-10-16 11:56:25
[2016-10-16 22:09:28]
User13668 - Posts: 296
Great addition - thanks.

I seem to have the same situation as the poster above and are not sure about the logic of not taking into account the first bar of the next session.

Attached is an intraday daily chart of the regular (old pit session) trading hours for Crude Oil.

I have circled some of the extended lines that don't stop if they are breeched immediately on the next session.

Would it not have been possible to allow for that event/situation to be toggled on or off in Settings & Input?
imageSC Extend.JPG / V - Attached On 2016-10-16 22:09:21 UTC - Size: 208.73 KB - 623 views
[2016-10-16 22:24:49]
Sierra Chart Engineering - Posts: 104368
We see a slight mistake. The extension line should start on the prior bar. We will fix that.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-20 04:22:20]
tradernikki - Posts: 41
Is it possible to use this feature in the Daily OHLC study?
[2016-10-20 04:30:41]
Sierra Chart Engineering - Posts: 104368
Yes but we would not add this ourselves to that study. You can do that. Refer to:
https://www.sierrachart.com/index.php?page=doc/BuildCustomStudiesDLL.html
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-24 18:40:08]
Zosimus - Posts: 345
Great addition.
In which of the Studies files in ACS_Source can I find the source code ?
[2016-10-24 18:53:39]
Sierra Chart Engineering - Posts: 104368
Studies5.cpp contains this study:

scsf_ExtendClosesUntilFutureIntersection
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-26 04:02:42]
User13668 - Posts: 296
In the Swing Hi/Lo study it would appear the Extended Lines are taking precedence over any other study in relation to the Study Display Order regardless of what order the two Studies are listed in the Analysis > Studies > Studies to Graph listing.

I assumed that if a Study to draw a Stair Step plot for the Daily Hi/Lo was higher up the listing than the Swing Hi/Lo study, that the former plots would be over the top of the Swing Hi/Lo Extended Line plots, but this is not the case.

I also noticed that changing the Draw Style and/or Line Style for the Line Properties under Swing Hi/Lo Study > Subgraphs (with Extend Swings until Future Intersection set to YES under Settings and Inputs) has no effect, so you can not even change the plot type to perhaps help deal with the above issue - was this intended?
[2016-10-26 04:19:25]
Sierra Chart Engineering - Posts: 104368
Regarding Post #10, we do not notice this and what you describe is technically impossible. However, your understanding is reversed. Refer to:

Chart Studies: Study Display Order
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-26 05:14:07]
User13668 - Posts: 296
Re post #11. Okay, so I see you might have added to the documentation (Chart Studies: Study Display Order) after I made my post as it is now clear the Study at the bottom of the list will be drawn LAST.

However I should have said in post #10 that I had already tried that as the documentation at that time was not clear.

So I still stand by my 'accusation' that the Extended Lines of the Swing Hi/Lo study is drawing over the top of other Studies even though the other study is the LAST in the list.

Attached as screen grab SC1 is a chart showing Stair Step Daily Hi/Lo as Green (Hi) and Red (Lo) dots. Arrows point to the 'naked' lines so you can see what tbey look like and then the same coloured hand drawn circles point to where they should be printing on TOP of the yellow and olive Extended Swing Lines where they overlap at the current Hi and Lo of the day.

I think you can agree Green Hi dots should show up over Yellow Swing lines as you can see the Daily Hi/Lo study is the LAST in the list and Green is a darker colour than Yellow.

To prove my point SC2 is the same screen grab EXCEPT I have made the Hi/Lo of the Day Green and Red dots equal to 3 pixels so they now overlap the 1 pixel width of the Extend Swing Hi/Lo lines. Note that it is only the overlap pixel on each side of the Extend Line that you can see for the Red/Green Day Hi/Lo dots - you will note you can still see the Yellow/Olive Extend Swing lines running through the middle of the dots.
Date Time Of Last Edit: 2016-10-26 05:15:22
imageSC1.JPG / V - Attached On 2016-10-26 05:13:51 UTC - Size: 121.84 KB - 598 views
imageSC2.JPG / V - Attached On 2016-10-26 05:14:01 UTC - Size: 64.51 KB - 622 views
[2016-10-26 05:20:37]
Sierra Chart Engineering - Posts: 104368
Respectfully, we are not going to get involved in post #11. That is a chargeable support request at 55 USD per hour. Take it or leave it. Please do not argue with us on this point. For the perspective of others, the account making the request is a high support load account to us and is through a broker which we receive very little from.

And even if you make referrals and use that as a cause to get extra support, we have no way to validate that, and still this is something we will not get involved in.

This is exactly the kind of support request that takes so much of our time from other development. And we know there is nothing wrong here. We do not know exactly what is going on in your scenario and are not willing to analyze it. Or even fully understand it.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-10-26 10:54:25
[2016-10-26 11:26:08]
User63439 - Posts: 83
Let us know what other studies you would like this functionality added to and we can do that.

hi there,

is it possible for you guys to add this function to the auto retracement/ projection study?
i would like to extend the 50% retracement of a 15 minute candle (see chart)
imageextensions.png / V - Attached On 2016-10-26 11:25:39 UTC - Size: 25.89 KB - 632 views
[2016-10-26 19:45:06]
User13668 - Posts: 296
Re post #12

Okay figured it out.

The problem is with the Daily OHLC study (not the Extended Lines in the Swing Hi/Lo study).

Solution: the option 'Draw Study Underneath Main Price Graph' must NOT be ticked in the Daily OHLC study > Settings and Input. In addition the Daily OHLC study must have Display precedence as already noted in this thread.

Not sure I understand why the option of drawing the study under or on top of the main price graph affects the drawing precedence of two studies - but it does.
[2016-10-30 10:56:43]
tradernikki - Posts: 41
I'm really lost. Would anybody be willing to share their usable study for extending close line in Daily OHLC?

Thank you
[2026-07-07 02:40:13]
kachowdary11 - Posts: 12
Hi Sierrachart engineering team:

Regarding the “Extending line till future intersection” function, could you please allow the crossover validation to use subgraphs!? ; if that is not possible could you please share the source code for this function internal validation and drawing lines!?

When I try to achieve this functionality with sc.Usetool lines, chart is scrolling is hanging because of too many line drawings… your way of implementation is efficient and you are not using usetool lines, could you please share the source code if possible!?
[2026-07-07 13:49:51]
John - SC Support - Posts: 47624
The sc.AddLineUntilFutureIntersectionEx() allows you to control the ending indexx. So you can determine where that crossover is occurring and then set the line to stop at that location. Refer to the following:
ACSIL Interface Members - Functions: sc.AddLineUntilFutureIntersectionEx()

We can not make our source code available.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2026-07-07 14:06:33]
kachowdary11 - Posts: 12
I Agree with you on controlling end index using sc.AddLineUntilFutureIntersectionEx();
I’m facing issue that the line stopped by candle(Intersection updating this end index Internally) before I set the EndIndex from Study( by the time my criteria is met , multiple candles intersecting the line).
Because of this, extending line stopped at past candle, it is getting updated when study function sets new EndIndex, the whole purpose is to get extending feature till last bar until my subgraph criteria is met.

Could you please suggest how to stop candle validation(happening internally by your source code) while using sc.AddLineUntilFutureIntersectionEx();

Looking forward!!
Date Time Of Last Edit: 2026-07-07 14:09:59
[2026-07-07 14:17:28]
John - SC Support - Posts: 47624
Set "AlwaysExtendToEndOfChart" to "1" until you have your condition met. Then, when your condition is met, update the line by setting "AlwaysExtendToEndOfChart" to "0" and setting "EndBarIndex" to the index you want.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2026-07-07 14:21:17]
kachowdary11 - Posts: 12
Thanks for the Response;
Nice Idea, Let me test it.

I will update you with the results!
Date Time Of Last Edit: 2026-07-07 14:21:39
[2026-07-13 04:34:43]
kachowdary11 - Posts: 12
Hi John/SC Support,

John suggested method worked for me!,

i am using text label for the extending line, it is displaying in price scale instead of right side free space of chart after last bar. For the same line update(from study function) with EndIndex and turning off AlwaysExtendToEndOfChart flag, text label is displayed properly near the EndIndex.

Another issue is sc.AddLineUntilFutureIntersectionEx() lines are always rendered on top of the main price graph, and the s_LineUntilFutureIntersection struct has no z-order / "draw underneath" member.

Could you please suggest the workaround or fix for this issues !!?

Looking forward!!
Date Time Of Last Edit: 2026-07-13 04:53:35
[2026-07-13 16:14:07]
John - SC Support - Posts: 47624
The study that sets the extension lines needs to have the option for "Draw Study Underneath Main Price Graph" enabled. Refer to the following:
Chart Studies: Settings and Inputs Tab >> Draw Study Underneath Main Price Graph (in the same Chart Region)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2026-07-13 16:48:57]
kachowdary11 - Posts: 12
Hi John

I am talking specifically about the extending line issues:
1) Text label for Lines with AlwaysExtendToEndOfChart = 1 " are displaying on price scale ( Attached screenshot).
2) Extending lines drawn with sc.AddLineUntilFutureIntersectionEx() are always displaying on top of 'Main Price Graph' :: [Note: Even we set the sc.DrawStudyUnderneathMainPriceGraph = 1; // 1 is True, 0 is False --> in set defaults block ]

These two issues are related to the source code for this feature. I have attached two screenshots in support to above description.

Please feel free if you need any other supporting evidence from my side to pin point this issue with sc.AddLineUntilFutureIntersectionEx() source code.
imageExtendingline_TextDisplay_Issue_1.png / V - Attached On 2026-07-13 16:44:01 UTC - Size: 55.68 KB - 29 views
imageExtendingline_Drawunderneath_Issue_2.png / V - Attached On 2026-07-13 16:45:46 UTC - Size: 110.55 KB - 31 views
[2026-07-13 19:06:52]
John - SC Support - Posts: 47624
With regards to the Name/Value label, there are members of the s_LineUntilFutureIntersection structure that control whether these are drawn. Refer to the members named "DrawValueLabel" and "DrawNameLabel" in this section:
ACSIL Interface Members - Functions: sc.AddLineUntilFutureIntersectionEx()

With regrds to extension lines drawing above/below the main price graph, when we test this, if the setting for "Draw Study Underneath Main Price Graph" is enabled through the interface, or if it is forced in the study through sc.DrawStudyUnderneathMainPriceGraph being set to 1, then the markers and extension lines are drawn beneath the Main Price graph.

Note that if you do not change the color of the extension lines and leave it as the default purple-ish color, then this may not be obvious that it is below the main price graph. Try changing to a color such as grey that will make it more obvious if the lines are above/below the main price graph.

If you continue to have an issue with this, then there must be something about your code that is not doing something correct with this. Try it through the interface and see if it works properly for you there without forcing it through code.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2026-07-14 19:45:04]
kachowdary11 - Posts: 12
Thanks John, that's helpful. Based on your response I've made the following change and confirmed behavior on my end:

Value / Name labels — I've verified and now set these explicitly on every n_ACSIL::s_LineUntilFutureIntersection I draw:
LineStruct.DrawValueLabel = 0; // value label OFF
LineStruct.DrawNameLabel = 1; // name label ON
LineStruct.NameLabel.Format("%s", OriginLabel.c_str());

So only the name label is drawn. (DrawValueLabel was already 0 by struct default, so this only made it explicit.)

Remaining issue — name label position for always-extending lines

For lines drawn with:
LineStruct.EndBarIndex = 0;
LineStruct.AlwaysExtendToEndOfChart = 1; // active/extending line

the name label renders on/over the right-side value (price) scale, rather than in the right-side free space of the chart. For lines stopped at a specific EndBarIndex (AlwaysExtendToEndOfChart = 0), the name label renders correctly at that bar in chart space.

Looking at the s_LineUntilFutureIntersection struct, I don't see any member controlling the label's position, alignment, or anchor — only DrawNameLabel (on/off) and NameLabel (the text). The label appears to auto-anchor to the line's right terminus, which for an always-extending line falls at the far-right edge over the value scale.

Questions:

Would it be possible to add label position/alignment control (or an option to anchor the name label to the last bar rather than the extended terminus) in a future release?
Can you confirm there is no per-line z-order member on s_LineUntilFutureIntersection (I understand z-order is controlled study-wide via DrawStudyUnderneathMainPriceGraph)?
If there's no supported way to reposition the label today, please let me know what you'd need from my end (sample chartbook, study DLL, screenshots, exact chart settings, etc.) and I'll provide it.

Thanks again for your help.

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

Login

Login Page - Create Account