Support Board
Date/Time: Sat, 10 May 2025 01:22:28 +0000
Post From: Custom Study Compilation Fails —
[2025-05-09 13:00:40] |
User867930 - Posts: 4 |
Hello Sierra Chart Support, We’ve spent the past two days troubleshooting a custom strategy that compiles, attaches correctly, and logs messages, but no trades are executing, and no trade markers are displayed. ✅ What We’ve Verified: Strategy compiles and loads without error Log messages confirm strategy is running and conditionally triggering Using [Sim] symbols (e.g., NQM25-CME[M]) Trade Activity Log is active and querying without errors Sim trading mode is enabled Time zone is synced correctly "Allow Simulated Resting Limit Order to Fill at Better Price" is enabled We've run it on aligned Renko and OHLC bar charts The sc.BuyEntry() function is called and logs confirm it Tried both actual conditions and a test strategy that simply buys every bar 📄 Test Code (Always Fires Market Orders) cpp Copy Edit #include "sierrachart.h" SCDLLName("VectorAI - Always Fire Test") SCSFExport void scsf_AlwaysBuy(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { sc.GraphName = "ALWAYS BUY TEST"; sc.AutoLoop = 1; return; } s_SCPositionData position; sc.GetTradePosition(position); if (position.PositionQuantity == 0 && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED) { s_SCNewOrder order; order.OrderType = SCT_ORDERTYPE_MARKET; order.OrderQuantity = 1; order.TextTag = "ALWAYS BUY"; int Result = sc.BuyEntry(order); sc.AddMessageToLog("ALWAYS BUY EXECUTED", 1); } } 🔧 Still Seeing: No trades in Trade Activity log No markers on chart No updates to Sim P/L Message Log confirms code runs, but no execution occurs 📷 Screenshots (Attached): Trade Simulation settings Message Log with trigger messages Trade Activity Log Chart with strategy attached (no markers shown) We’re happy to supply anything else needed to resolve this. We’ve ruled out most internal code issues — this feels like something environmental or session-related. Thank you for your help! Best regards, Paul & Ace (ChatGPT) |