Support Board
Date/Time: Wed, 12 Feb 2025 18:49:17 +0000
ACSIL : save image per closed bar ?
View Count: 828
[2020-11-07 13:43:12] |
User818063 - Posts: 16 |
Hi, Is it possible to save an image in ACSIL, each time a study function returns to Sierra code ? (I use using sc.SaveChartImageToFileExtended). The documentation states that if the save function is called multiple times during a call into a study function, only the most recent call will be processed. If I understand correctly, it means an image can be saved after after each call into a study function. For example, I could do screenshot once per closed bar. Unfortunately, this does not work, only the last image was saved, which means I do not understand the documentation, or that something is wrong with the save function. Please advise. Here is a small study for making a screenshot per closed bar to illustrate the problem. #include "sierrachart.h" SCDLLName("SSTest") SCSFExport scsf_SSTest(SCStudyGraphRef sc) { if (sc.SetDefaults) { sc.GraphName = "SCTest"; sc.AutoLoop = 1; return; } // compute once per bar if (sc.GetBarHasClosedStatus(sc.Index) != BHCS_BAR_HAS_CLOSED) return; // make a screenshot, format is <symbol>.<barnumber>.png SCString _imageFileName; _imageFileName.Format("%s.%d.png", sc.Symbol.GetChars(), sc.Index); sc.SaveChartImageToFileExtended(sc.ChartNumber, _imageFileName, 0, 0, 0); } -- W |
[2020-11-08 01:06:08] |
|
We are testing this.
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 |
[2020-11-08 01:21:00] |
|
You will want to use code like this: SCSFExport scsf_ChartImageTest(SCStudyGraphRef sc) When you are setting the path and filename, make sure that you are including the path as well.{ if (sc.SetDefaults) { sc.GraphName = "ChartImageTest"; sc.AutoLoop = 0; return; } // compute once per bar if (sc.UpdateStartIndex == sc.ArraySize - 2) sc.SaveChartImageToFileExtended(sc.ChartNumber, SCString(), 0, 0, 0); } The problem is, there is a delay before the chart image is saved. We will look into making it immediate. We need to think through 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 |
[2020-11-08 11:23:32] |
User818063 - Posts: 16 |
We need to think through that.
Thank you. FWIW, I believe being able to make an image after each call to the custom study function is useful if used carefully. For example for back testing and generation images on key moments. -- w. |
[2020-11-08 22:41:07] |
|
We have worked out a solution and this will be implemented in the next release coming out by morning. Although not sure how well it would work during a fastback test since the chart is deliberately not always drawn at every calculation. 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: 2020-11-08 22:42:06
|
[2020-11-09 21:16:35] |
User818063 - Posts: 16 |
We have worked out a solution and this will be implemented in the next release coming out by morning.
Thank you. Let me know when this is available. If it is already available in 2192, then, on my side, the behavior is the same. 1 image saved although a request is done on each closed bar. -- W. |
[2020-11-09 22:12:49] |
|
This is going to take us longer. Will not be until tomorrow.
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 |
[2020-11-11 09:46:08] |
User818063 - Posts: 16 |
Hi. I executed my program on 2193 and the SaveChartImageToFileExtended behavior has changed. He is my test if useful. The custom study generates now one image per closed bar, but the images are all identical in spite of my request to make a different image per call (I update the chart index start). I also noticed a different behavior when reecuting the study or reloading the chart. Enclosed-by my simple program and a screenshot of my logs if useful. Please advise. -- W |
![]() ![]() Attachment Deleted. |
[2020-11-11 09:59:42] |
|
We ran a test using the code in post #3. The function does work correctly. The chart images are all different. It is important to understand that the chart images are taken after the study function returns. You cannot call the function multiple times during the same run of the study function and expect the chart image to be different. They will all be the same. We will solve the problem you describe in #2 in that graphic image. 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: 2020-11-11 10:00:06
|
[2020-11-11 22:36:37] |
User818063 - Posts: 16 |
We ran a test using the code in post #3. The function does work correctly.
Yes. but it does not do what I wanted and why I asked for help :)Is it possible to provide a synchronous function that makes a screenshot of the chart from bar X to bar Y ? |
[2020-11-12 17:41:30] |
|
No this is not possible. We cannot provide further help.
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: