Support Board
Date/Time: Wed, 15 Jan 2025 12:44:26 +0000
Last price of a developing bar
View Count: 702
[2017-06-15 21:01:18] |
rhovega - Posts: 279 |
I need to reference the last price of a developing bar using ACSIL. For example, I would have expected the following code to plot a square when the last price of a closed bar is equal to the prior bar's high: if (sc.Close[sc.Index] == sc.High[sc.Index-1] && sc.GetBarHasClosedStatus(sc.UpdateStartIndex) == BHCS_BAR_HAS_CLOSED) {PlotSquareSubgraph[sc.Index] = sc.Close[sc.Index] ;} And the following code to plot a square when the last price of a developing bar is equal to the prior bar's high: if (sc.Close[sc.Index] == sc.High[sc.Index-1]) {PlotSquareSubgraph[sc.Index] = sc.Close[sc.Index] ;} Instead, both codes do exactly the same: plot a square when the last price of a closed bar is equal to the prior bar's high. I am thus unable to reference the last price of a developing bar. How can I do that? Thanks Date Time Of Last Edit: 2017-06-16 00:35:34
|
[2017-06-16 18:24:14] |
Sierra Chart Engineering - Posts: 104368 |
This code is wrong: sc.GetBarHasClosedStatus(sc.UpdateStartIndex)
It needs to be sc.GetBarHasClosedStatus(sc.Index) And make sure you are not using sc.GetBarHasClosedStatus anywhere else in the function. You should also be aware of floating-point error: http://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scFormattedEvaluate 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 |
To post a message in this thread, you need to log in with your Sierra Chart account: