Support Board
Date/Time: Wed, 08 Oct 2025 08:16:12 +0000
Post From: Advice for ACSIL bot guards/checks
[2025-10-06 07:42:43] |
bozo_j - Posts: 27 |
Hi guys, I am new to writing Sierra bots. Pretty soon it became obvious that extremely important part is writing all kinds of guards (checks) so that bot does not trade when it is not supposed to, unrelated to the actual trading signals, as well as checking various "technical" things related to how Sierra works before starting to trade. For example, it should only trade on new candles, and not on the historic ones, it should not trade live if that setting is not enabled and so on. Can you please assist with ideas on what a production-grade bot should check as it relates to technical/non-trading-signal items, which just make sense and should be a part of any well behaved trading bot? Maybe some special considerations for Replaying/Testing etc. Here's what I have so far: //---------------------------------------------------------- // SAFETY GUARDS //---------------------------------------------------------- if (sc.HideStudy) return; if (sc.IsFullRecalculation) return; if (sc.ChartIsDownloadingHistoricalData(sc.ChartNumber)) return; //---------------------------------------------------------- // SIMULATION vs LIVE CHECK //---------------------------------------------------------- bool allowLive = AllowLiveTradingInput.GetYesNo(); bool isSimulation = sc.GlobalTradeSimulationIsOn; if (!isSimulation && !allowLive) { sc.AddMessageToLog("TRADING BLOCKED: Live account detected with [Allow Live Trading] = No", 1); return; } // Little fuzzy on this one - the idea is that it does not trade on old candles, but not sure it is implemented correctly: SCDateTime& StudyStartTime = sc.GetPersistentSCDateTime(BOT_START_TIME_KEY); if (StudyStartTime == 0) { StudyStartTime = sc.BaseDateTimeIn[sc.ArraySize - 1]; return; // Do not trade during the initialization bar } // --- Skip bars before study was started --- SCDateTime CurrentBarTime = sc.BaseDateTimeIn[sc.Index]; if (CurrentBarTime < StudyStartTime) return; Thanks in advance for any assistance! Date Time Of Last Edit: 2025-10-06 07:57:52
|