Login Page - Create Account

Support Board


Date/Time: Sun, 07 Sep 2025 19:00:53 +0000



[Programming Help] - Custom Study Compiles and Loads, but Function Never Executes (No Logging or Orders)

View Count: 372

[2025-08-04 17:19:39]
User792880 - Posts: 8
Hi Support,

I’m developing a custom study DLL using Sierra Chart version 2776 (64-bit). The study compiles successfully using the official sierrachart.h from ACS_Source and produces a cleansmt_final_64.dll. It appears in the “Add Custom Study” window and adds to the chart without error.

However, the study function never appears to execute. I’ve confirmed the following:

✅ The DLL is built with Visual Studio 2022 and placed in the correct /Data directory
✅ The chart is receiving live data (GCZ25_FUT_CME) and bar timestamps are updating
✅ sc.AutoLoop = 1; and sc.UpdateAlways = 1; are set in sc.SetDefaults
✅ The study is running in Trade Simulation Mode
❌ No messages from sc.AddMessageToLog() appear in the Message Log
❌ No orders are placed, even when logic is forced to trigger
❌ A minimal test study that logs on every bar also shows no activity
I’ve also confirmed that the correct 64-bit DLL is being compiled and loaded, and I’ve tried renaming the 32-bit version to eliminate confusion. Still, nothing logs and the function never appears to run.
Is there anything I may be overlooking regarding DLL discovery or study execution under version 2776 (64-bit)?
Thanks for your help.

Jack
[2025-08-04 18:36:26]
User431178 - Posts: 771
What is this set to?
Automated Trading Management: SendOrdersToTradeService

Lots of info here for auto trading
Automated Trading From an Advanced Custom Study

Various examples in ACS_Source folder of your SC intallation.

If you don't figure it out from that and want more help, might benefit to post the code here.
[2025-08-04 21:49:32]
User792880 - Posts: 8
Hi,
Thanks for the quick response. I recently updated to the latest version of Sierra Chart and am using the fresh ACS_Source folder that came with it.

In response to your question:
Automated Trading Management → SendOrdersToTradeService is currently set to FALSE, since I’m running in Trade Simulation Mode with Replay.

I’ve compiled a custom DLL (logtest.dll) using the updated sierrachart.h, placed it in the correct folder, and successfully loaded it into a chart using Analysis → Studies. The study appears as expected, but:

No trades are executing during replay
Nothing is printed to the Message Log (even simple log messages using sc.AddMessageToLog())
I’ve double-checked that:
Trade simulation is enabled
The chart is actively replaying data
The study is properly added to the chart and visibly running
I’ve based the structure on examples in the ACS_Source folder. If needed, I’m happy to share the .cpp file.
Are there any new behavioral changes or execution flags introduced in the latest version that could suppress logging or trade execution during replay?

Thanks again for your help,
Jack
[2025-08-04 22:00:49]
User792880 - Posts: 8
#include "sierrachart.h"
#define SCSFExport extern "C" __declspec(dllexport)

SCDLLName("Log Test")
#include "sierrachart.h"

SCDLLName("Debug_AutoTrade");

SCSFExport void scsf_DebugAutoTrade(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "DEBUG: AutoTrade Trigger";
sc.StudyDescription = "Minimal example to test auto trading and logging.";
sc.AutoLoop = 1;
sc.GraphRegion = 0;
sc.UpdateAlways = 1;
return;
}

if (sc.Index == 0)
{
sc.AddMessageToLog("✅ Study initialized.", 0);
}

// Just to confirm this is firing every bar
sc.AddMessageToLog("🔁 Tick update", 0);

// Dummy trade entry once at index 5
if (sc.Index == 5)
{
s_SCNewOrder order;
order.OrderType = SCT_ORDERTYPE_MARKET;
order.OrderQuantity = 1;
order.TextTag = "Test Entry";

sc.BuyEntry(order);
sc.AddMessageToLog("📥 Sent BuyEntry at index 5", 0);
}
}


This is a reduced version of the script. I'm running v2776 (just updated)
SendOrdersToTradeService is set to Yes
I have no trades or logs showing despite correct simulation mode
I tested with the above minimal study, and it still didn’t log or trade
[2025-08-05 08:37:56]
User431178 - Posts: 771

#include "sierrachart.h"
SCDLLName("Log Test")

SCSFExport scsf_DebugAutoTrade(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    sc.GraphName = "DEBUG: AutoTrade Trigger";
    sc.StudyDescription = "Minimal example to test auto trading and logging.";
    sc.AutoLoop = 1;
    sc.GraphRegion = 0;
    sc.UpdateAlways = 1;
    return;
  }

  if (sc.Index == 0)
  {
    sc.AddMessageToLog("Study initialized.", 0);
  }

  // Just to confirm this is firing every bar
  sc.AddMessageToLog("Tick update", 0);

  // Dummy trade entry once at index 100
  if (sc.Index == 100)
  {
    s_SCNewOrder order;
    order.OrderType = SCT_ORDERTYPE_MARKET;
    order.OrderQuantity = 1;
    order.TextTag = "Test Entry";

    sc.BuyEntry(order);
    sc.AddMessageToLog("Sent BuyEntry at index 100", 0);
  }
}

Try using the remote compiler with this code, it compiles and does what it is meant to.

Unless you use Trade Menu: AutoTrade System Replay Backtest (Trade menu) it is unlikely that the replay will include bar index 5, and trades are not executed during recalculation, so I changed "if (sc.Index == 5)" to "if (sc.Index == 100)". Try it and check the outcome (you can add the Bar Numbering study to check that your replay includes the specified bar).


SendOrdersToTradeService is set to Yes

You mean it's set to no (correct for sim), the deafult value, as you are not explicitly setting it here.


Do yourself a favor and look at the various study and trading system examples in the ACS_Source folder of your SC installation.
You will probably find that you save some time and headaches by using/modifying the examples, compared to relying on LLM for coding.
[2025-08-18 17:42:38]
User792880 - Posts: 8
Hi Support,
I successfully compiled the log_test.cpp file using your example (the one with sc.Index == 100), and the build completed without errors. I then applied the custom study (DEBUG: AutoTrade Trigger) to a chart, enabled both Auto Trading - Global and Auto Trading - Chart, and started a replay using Trade → AutoTrade System Replay BackTest.
However, no trades were triggered, and more importantly, the Message Log remains completely empty — I don’t even see "Study initialized" or "Tick update" messages. It seems the script isn’t running at all, even though it’s applied to the chart.
I’ve confirmed:
The study appears in the Studies list and is active.
The DLL is compiled and listed under Analysis → Add Custom Study.
Replay is set to start well before bar index 100.
I’ve added a bar numbering study and confirmed the chart reaches/passes index 100.
I also tried lowering the index check to 10 and recompiling — still no logs or trades.
Is there something I might be missing to get the study to execute? Could this be related to the way the DLL is registered or initialized?
Thanks for your help.
[2025-08-20 22:46:18]
ForgivingComputers.com - Posts: 1114
The Trade Service Log may have information that would tell you what is happening. This is the place to look if you find nothing in the Trade Activity Log.
Date Time Of Last Edit: 2025-08-20 22:47:56
[2025-08-25 21:34:09]
User792880 - Posts: 8
Hi Support,
Thanks for your earlier replies and suggestions. I wanted to follow up because I’m still stuck on a core issue: the Message Log is always empty when running a custom study, even though the DLL compiles and loads without error.

Here’s the full context:
I’m running Sierra Chart under Parallels on an M1 MacBook Air. I’ve confirmed I am launching the ARM64 executable (SierraChartARM64.exe).
I initially struggled with compiling, since the Visual Studio environment didn’t include the ARM64 toolchain. After adding the correct components, I can now build with:

cl /LD log_test.cpp /I"C:\SierraChart_New\ACS_Source" /link /OUT:"C:\SierraChart_New\Data\log_test.dll"

and verify the output as machine (ARM64) using dumpbin.
I’ve cleaned up duplicates and confirmed only log_test.dll exists in the /Data folder.
I also updated Sierra Chart to the required version (≥ 2779). The DLL now loads successfully on startup (Message Log shows Loaded custom studies DLL: log_test.dll at least once when I first switched to the ARM64 build).
But now the main problem:
Once the study is added to a chart, no further log messages ever appear.
Even a minimal study that should log "Study initialized." and "Tick update" on every bar produces nothing.
No trades are executed during Replay, even with Auto Trading (Global + Chart) enabled in Simulation Mode.
A “visibility patch” version of the script that draws on-chart labels and fires alerts also shows no output, which suggests the study function isn’t being called at all.
To summarize what’s been confirmed:
Study compiles cleanly with the official sierrachart.h
DLL is ARM64, in the correct folder, and selectable under Add Custom Study
AutoLoop = 1 and UpdateAlways = 1 are set
Trade Simulation Mode and Replay are enabled
Auto Trading is enabled (Global and Chart)
No execution of study code (no logs, alerts, or orders) once it’s on the chart
The strange part is that in an earlier ARM64 run (before I recompiled everything cleanly with the batch file) the Message Log was at least full of activity, but after fixing the environment and headers, it is now consistently blank. It seems like Sierra Chart is loading the DLL but not actually calling the study function.
Could this be related to Parallels, or is there something about how the ARM64 build discovers/executes studies that I may be missing? Any guidance would be greatly appreciated — at this point I mainly need to confirm that the study execution pipeline is working at all.

Thanks
[2025-08-26 10:10:32]
User431178 - Posts: 771
I wanted to follow up because I’m still stuck on a core issue: the Message Log is always empty when running a custom study, even though the DLL compiles and loads without error.

So there are no error messages at all in the message log?
Does the study perform correctly if you build using the remote compiler instead of VS?
[2025-08-26 14:44:58]
User792880 - Posts: 8
The Message Log is completely empty. I do not see any startup lines, and I have never seen study-generated logs. The study attaches without error but never produces log output, alerts, or orders.
I have not tried the Remote Compiler yet. Can you confirm whether it produces ARM64 DLLs, or only x64? I am running SierraChartARM64.exe under Windows 11 ARM in Parallels, so I want to be sure I test with the correct target.
Thanks
[2025-08-26 14:59:04]
User431178 - Posts: 771
I have not tried the Remote Compiler yet. Can you confirm whether it produces ARM64 DLLs

Yes it does, you can use the command Remote Build - ARM64.
[2025-08-26 18:27:47]
ForgivingComputers.com - Posts: 1114
The Message Log is completely empty.

It should not be empty. There should be text in the log when starting Sierra Chart. Your study adds to the message log. I suspect there is a Mac/Parallels/Windows issue.

Also, this message will not only print on every bar, it will print every time the study is called.

// Just to confirm this is firing every bar
sc.AddMessageToLog("Tick update", 0);

If you change it to this, it will only fire once per bar.

// Just to confirm this is firing every bar
if (sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED)
sc.AddMessageToLog("Tick update", 0);

[2025-08-27 18:53:16]
ondafringe - Posts: 327
Give Claude and ChatGPT a link to this thread and ask them to analyze the problem and provide possible solutions. They may or may not help you solve the problem, but it's worth a try.
[2025-08-28 23:59:00]
ForgivingComputers.com - Posts: 1114
I also am not able to get the Message Log to open with Parallels. I went back to one of the early ARM versions, 2739, and it has the same problem. I tried the fixes suggested by ChatGPT, but they didn't work. I do not have the problem with VMWare Fusion on my Mac M4 Mini.

I don't expect Sierra Chart Engineering to see this as a priority, as they already want to be Microsoft-Independent. So, making it work in emulation on a Mac is not likely to happen. However, it could also be a Parallels compatibility issue. We users get stuck between the two sides pointing the figurative fingers at each other.
[2025-08-30 15:03:05]
User792880 - Posts: 8
Thanks for the guidance so far. I’ve now confirmed the following:
The DLL compiles successfully for ARM64 using Visual Studio 2022 (and also with Remote Build – ARM64).
The DLL appears under Add Custom Study, can be attached to a chart, and loads without error.
The study sets sc.AutoLoop = 1 and sc.UpdateAlways = 1.
Trade Simulation Mode and Auto Trading (Global + Chart) are enabled.
Replay runs well past the trigger index (I verified with Bar Numbering).
Problem:
Once the study is added, no further output ever appears.
The Message Log is completely empty (not even startup lines).
No sc.AddMessageToLog calls, alerts, or orders are visible.
The Trade Activity Log remains empty even when sc.BuyEntry() should fire.
This happens both with the minimal “log_test.cpp” example and with a patched version that also draws on-chart labels and fires alerts. Both appear attached in the chart’s study list but produce no runtime activity.
At this point the DLL loads but the study function itself never seems to execute.
Environment:
SierraChartARM64.exe ≥ 2779
Windows 11 ARM running inside Parallels on an M1 MacBook Air
ACS_Source and Data folders cleaned and placed correctly
DLL verified as machine (ARM64) with dumpbin
Another user on the forum also reported the same symptom — Message Log stays blank under Parallels but works under VMware Fusion.
Question:
Could you confirm whether this is in fact a Parallels/ARM64 compatibility issue (Message Log and study execution not working in that environment), rather than a problem with my code or build process?
That confirmation would help me decide whether to keep troubleshooting locally or move to a different VM solution (e.g., VMware Fusion or a Windows cloud host).
Thanks very much,
[2025-08-30 15:41:25]
ForgivingComputers.com - Posts: 1114
Could you confirm whether this is in fact a Parallels/ARM64 compatibility issue (Message Log and study execution not working in that environment), rather than a problem with my code or build process?

If the remote ARM build isn't working either, then it is not your build process.

I would agree it is a compatibility issue. I have the same problem on Parallels Desktop 20. However, there are others on the forum who have had success with Parallels on Apple Silicon. Perhaps there was a Parallels update that broke things, as the earliest SierraChart_ARM64.exe I could find was 2739 on my Fusion VM, and it also had the same issue with Parallels. I think this needs to be referred to Parallels support. I tested Parallels 26 also, and there was no change. I was not able to go back to Parallels 19, as it crashed opening the VM I had, and one it tried to download.

There are several posts about OpenGL not being compatible. Not sure if any of them had issues with the Message Log or the TAL.
Date Time Of Last Edit: 2025-08-30 18:22:51
[2025-08-31 02:19:55]
User792880 - Posts: 8
Thanks everyone for the help so far. Based on all the testing we’ve done, I’m convinced this isn’t a build process issue — the same DLL compiles cleanly, loads in Sierra, but once attached to a chart the study never executes. The Message Log remains completely blank (not even startup lines), no alerts or drawings appear, and no orders are placed, even in simulation mode with Auto Trading enabled.
Since other users have reported the same symptom under Parallels but not under VMware Fusion or native Windows, it seems likely this is a Parallels/Windows ARM compatibility problem rather than a Sierra Chart issue.
I’m planning to open a ticket with Parallels support, but before I do:

Is there a specific way I should describe this problem to them that would be most helpful? For example, should I frame it as:
“The Message Log window in SierraChartARM64.exe never updates under Parallels,”
“Custom study DLL callbacks never execute under Parallels Windows ARM,” or
“Filesystem/graphics virtualization under Parallels might prevent Sierra’s logging and study execution pipeline from running”?
Any advice on the best technical angle to give Parallels would be much appreciated.
Thanks again.
[2025-08-31 09:56:51]
User431178 - Posts: 771
the same DLL compiles cleanly, loads in Sierra, but once attached to a chart the study never executes

As you are using VS, did you try stepping through the code in debugger before reaching the conclusion that the study never executes?
[2025-08-31 14:47:14]
ForgivingComputers.com - Posts: 1114
Is there a specific way I should describe this problem to them that would be most helpful? For example, should I frame it as:
“The Message Log window in SierraChartARM64.exe never updates under Parallels,”
“Custom study DLL callbacks never execute under Parallels Windows ARM,” or
“Filesystem/graphics virtualization under Parallels might prevent Sierra’s logging and study execution pipeline from running”?
Any advice on the best technical angle to give Parallels would be much appreciated.

All of the above. Make sure you mention which version of Parallels (e.g. 20 or 26).

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account