Login Page - Create Account

Support Board


Date/Time: Tue, 26 Aug 2025 05:24:28 +0000



Post From: Custom Study Compiles and Loads, but Function Never Executes (No Logging or Orders)

[2025-08-04 22:00:49]
User792880 - Posts: 5
#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