Support Board
Date/Time: Fri, 13 Jun 2025 13:01:41 +0000
[Programming Help] - Request for a new ACSIL function
View Count: 156
[2025-06-10 21:42:03] |
Meklon - Posts: 241 |
Dear Support, I would like to ask if it would be possible to add a new ACSIL function to your already extended and available list. Specifically, I would like to get the Bar Has Closed status from a remote chart. i.e.: int GetBarHasClosedStatusFromChart(int ChartNumber, int BarIndex); This would be very useful and quite helpful in development of a custom studies which reference remote charts and need to make a logic decision based on the status of the closed current bar of the remote chart. Much appreciate it in advance. Date Time Of Last Edit: 2025-06-10 21:42:45
|
[2025-06-11 12:16:05] |
JohnR - User831573 - Posts: 333 |
This might work. In the remote chart, do the check for bar has closed. If yes, set a persistent variable. Then in this chart something like this - int g_RemoteBarClosed = sc.GetPersistentIntFromChartStudy(sc.ChartNumber,2,1) ; I have not done this, but saw it in another post. Reading Persistent variable in other study JohnR |
[2025-06-11 14:58:29] |
Meklon - Posts: 241 |
JohnR - thank you, this may work as a workaround, but will still require a study on the remote chart to be referenced (not very efficient and adding another layer). What would be really effective is to have an ACSIL function that would be possible to call directly from the code and just receive the status.
Date Time Of Last Edit: 2025-06-11 14:59:39
|
[2025-06-11 18:59:16] |
User719512 - Posts: 315 |
Your question implies the remote chart is running on a different timeframe than your main chart otherwise you'd already have the answer since the bar index would be the same. So for your question about "GetBarHasClosedStatusFromChart", what bar index value would you be passing to this function? How would you know what index to use without calling some API to know the number of bars in the remote chart/etc? I would think some combination of GetStudyArrayFromChart() and ArraySize() and/or mapping a DateTime form the main chart to bars on the remote chart/etc would be in order. Reference: ACSIL Interface Members - Functions: sc.GetStudyArrayFromChart() |
[2025-06-11 20:05:17] |
Meklon - Posts: 241 |
I am only interested in the status of the very last bar on remote chart (has it closed or still developing) so I can compare it to the LastBar(-1).
Date Time Of Last Edit: 2025-06-11 20:17:25
|
[2025-06-11 20:25:39] |
User719512 - Posts: 315 |
Have you looked at this from sierrachart.h? int GetBarHasClosedStatus(int BarIndex) { if (SetDefaults) return BHCS_SET_DEFAULTS; if (BarIndex != ArraySize - 1) return BHCS_BAR_HAS_CLOSED; else return BHCS_BAR_HAS_NOT_CLOSED; } The last bar on the chart will never be closed. Why? Because you don't know a bar is closed until a new one opens. Post #4 has all the info to get started on this and get the bars from the other chart, keep track of the ArraySize (last BarIndex you've processed) and when the index grows/etc. Date Time Of Last Edit: 2025-06-11 20:27:35
|
[2025-06-11 22:24:42] |
Meklon - Posts: 241 |
User719512 - I am attempting to monitor a real-time status of the currently developing bar on the remote chart and capture the exact moment it closes to determine if the trend is continuing by comparing HLOC as well as other values (i.e. Renko) to the bar before that. What you referring to in the header code provides a static status of the prior bar, not the currently developing bar. Am I missing something?
|
To post a message in this thread, you need to log in with your Sierra Chart account: