Support Board
Date/Time: Tue, 10 Mar 2026 04:57:08 +0000
Can't get code for ASCIL to work.
View Count: 18
| [2026-03-09 23:50:25] |
| User216753 - Posts: 25 |
|
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? |
To post a message in this thread, you need to log in with your Sierra Chart account:
