Support Board
Date/Time: Fri, 24 Apr 2026 12:06:30 +0000
Can't get code for ASCIL to work.
View Count: 351
| [2026-03-09 23:50:25] |
| User216753 - Posts: 26 |
|
Hello, AI is attempting to write code for me for a configurable ATR with ATR multiplier to adjust Renko bricks on the fly without recalculating previous bars. Only present and future bars. It came up with this: #include "sierrachart.h" SCDLLName("ATR-Based Renko Brick Size (Dynamic, No History Recalc)") SCSFExport scsf_ATRBasedRenko(SCStudyInterfaceRef sc) { SCInputRef ATRLength = sc.Input[0]; SCInputRef ATRMultiplier = sc.Input[1]; SCInputRef ATRPercent = sc.Input[2]; SCSubgraphRef ATRValue = sc.Subgraph[0]; if (sc.SetDefaults) { sc.GraphName = "ATR-Based Renko Brick Size (Dynamic)"; sc.AutoLoop = 1; ATRLength.Name = "ATR Length"; ATRLength.SetInt(14); ATRMultiplier.Name = "ATR Multiplier"; ATRMultiplier.SetFloat(1.0f); ATRPercent.Name = "ATR Percentage (0–100)"; ATRPercent.SetFloat(100.0f); ATRValue.Name = "ATR Value"; ATRValue.DrawStyle = DRAWSTYLE_LINE; ATRValue.PrimaryColor = RGB(0, 255, 0); return; } // --- Compute ATR using correct ACSIL signature --- sc.ATR(sc.BaseDataIn, ATRValue, sc.Index, ATRLength.GetInt(), MOVAVGTYPE_SIMPLE); float atr = ATRValue[sc.Index]; // --- Apply multiplier --- atr *= ATRMultiplier.GetFloat(); // --- Apply percentage --- atr *= (ATRPercent.GetFloat() * 0.01f); ATRValue[sc.Index] = atr; // --- Only update current & future bars --- if (sc.Index == sc.ArraySize - 1) { // Convert ATR price value to ticks float tickSize = sc.TickSize; int ticks = (int)(atr / tickSize); if (ticks < 1) ticks = 1; sc.RenkoTicksPerBar = ticks; // Correct for your ACSIL version sc.FlagFullRecalculate = 0; // Prevent history recalc } } The compiler says this: -- Starting remote build of Custom Studies Source files: ATRDynamicRenkoBars.cpp. 64-bit -- 19:26:34 Allow time for the server to compile the files and build the DLL. Server: https://build.sierrachart.com The remote build is complete. The build failed. ATRDynamicRenkoBars.cpp: In function 'void scsf_ATRBasedRenko(SCStudyInterfaceRef)': ATRDynamicRenkoBars.cpp:56:12: error: 'struct s_sc' has no member named 'RenkoTicksPerBar' 56 | sc.RenkoTicksPerBar = ticks; // Correct for your ACSIL version | ^~~~~~~~~~~~~~~~ Failed to generate the dll file. -- End of Build -- 19:26:37 AI says: Robert… this error tells me something extremely important: 👉 Even after updating, your Sierra Chart still does NOT have sc.RenkoTicksPerBar That means your update did not actually install the current ACSIL header. This happens when: • Sierra Chart updates the program but not the remote build compiler, or • The remote compiler is still using your old custom studies folder, or • You updated to a version that still predates the Renko API changes. But here’s the good news: ⭐ The current Sierra Chart API uses: • sc.SetRenkoBrickSize ← modern • sc.RenkoBrickSizeValue ← transitional • sc.RenkoTicksPerBa ← older transitional • NONE of these exist in your header So your ACSIL environment is still on the pre‑Renko‑API era, where Renko brick size cannot be changed from ACSIL at all. This is why every attempt fails. ✅ What we do next (and this WILL work) Since your environment does not expose any Renko brick size control, the only solution that will compile is: ✔ ATR indicator only ✔ Displays the recommended brick size ✔ You manually enter the brick size in Chart Settings → Renko This avoids all unsupported API calls and will compile 100% successfully. ✅ Guaranteed‑to‑compile ATR‑Only Version Copy/paste this into Sierra Chart: 🎉 What this version gives you ✔ ATR line ✔ Recommended Renko brick size (in ticks) ✔ No unsupported API calls ✔ 100% guaranteed to compile ✔ You manually enter the brick size in Chart Settings If you want dynamic Renko control… I can tell you exactly which Sierra Chart version you need and how to confirm your ACSIL header version. Just say the word and I’ll walk you through it. How do I get this to work so I dont have to manually enter brick size? Or do I have to use a previous version? |
| [2026-03-10 05:33:27] |
| Tony - Posts: 714 |
|
ACSIL Interface Members - Variables and Arrays: sc.RenkoTicksPerBar Good luck let "AI" do the ACSIL for you ... |
| [2026-03-10 12:12:49] |
| User431178 - Posts: 863 |
|
Your AI is lying to you. adjust Renko bricks on the fly without recalculating previous bars. Only present and future bars Not possible, if you change the renko size the chart will recalculate. |
| [2026-03-10 19:54:07] |
| User216753 - Posts: 26 |
|
The compiler is rejecting all of these lines of code: ⭐ The current Sierra Chart API uses: • sc.SetRenkoBrickSize ← modern • sc.RenkoBrickSizeValue ← transitional • sc.RenkoTicksPerBa ← older transitional • NONE of these exist in your header So your ACSIL environment is still on the pre‑Renko‑API era, where Renko brick size cannot be changed from ACSIL at all. This is why every attempt fails. What is the line of code I need to accomplish this? If I'm not on the right track, please work with me on how to accomplish dynamic renko bars. I would appreciate a helpful and thoughtful response, not blanket dismissive one. I've paid a lot of money to sierra over the years and I deserve respectful consideration. |
| [2026-03-10 20:33:15] |
| User431178 - Posts: 863 |
|
What is the line of code I need to accomplish this? If I'm not on the right track, please work with me on how to accomplish dynamic renko bars. I would appreciate a helpful and thoughtful response, not blanket dismissive one. I've paid a lot of money to sierra over the years and I deserve respectful consideration. I am nothing to do with support, just another user. My original point still stands - you are asking how to "adjust Renko bricks on the fly without recalculating previous bars. Only present and future bars", I am telling you that it is not possible, changing the bar parameters means that the entire chart will reload, therefore recalculating previous bars. Telling you that something is not possible is not being dismissive, it is a statement of fact, I can't help it if you don't like the answer. Pointing out that your chat bot is lying to you is not being dismissive either, again just a fact. There is extensive documentation relating to all things ACSIL, as well a search function, you could probably find the required information yourself. The other user, Tony, gave you a link to the relevant variable, and if you read the linked documentation you would see that it is deprecated and there is another link to the correct function. Here is that function - ACSIL Interface Members - Functions: sc.SetBarPeriodParameters() - but as stated, it does not achieve your desired goal. |
| [2026-03-12 19:09:32] |
| ForgivingComputers.com - Posts: 1215 |
|
I respect that people want to be able to create their own studies with AI. You will find the road is bumpy, but with perseverance and patience, you can get a lot done. As was mentioned above, whatever AI you are using it is not able to do what you are asking. It is a limitation of Sierra Chart, and you cannot code around it. You AI doesn't know that, so it makes things up that look like they would work. It is working off patterns it has seen before, not true knowledge. As a developer I find it difficult to get them to create truly complex studies. You spend a lot of time getting them to fix compiler issues. Then when it compiles it only does some things correct and hallucinates others. If you don't understand ACSIL, it is difficult to prompt it with "it doesn't work right" messages. That being said, I do use ChatGPT and Claude on occasion for problem solving: like things I haven't done before. Since ACSIL has changed over the years there are many functions that no longer work. AI continues to offer them, because they were trained on the body of works it could find going back who knows how far. When you tell AI the function doesn't exist, it happily says "You're Right!" But it won't remember that because it is reading from its "book" and users cannot change what is written in the book. I still use them as a tool to help with coding. GitHub CoPilot in Visual Studio helps with making changes as it sees what you just did and suggests new edits in grey. Hit Tab to accept them. Date Time Of Last Edit: 2026-03-12 19:11:48
|
To post a message in this thread, you need to log in with your Sierra Chart account:
