pseudocode
#Strategy Name = Multi-Indicator Hard-Vote with Trend Filter (GBPUSD H4, Optimized) Type = MetaTrader Symbol = GBPUSD Timeframe = H4
#StrategyCharts Main chart = GBPUSD / H4
#MoneyManagement Method = Fixed size, 0.1 lots Initial Capital = 10000
#Variables
#Signals [Signals, OnBarUpdate, OnBarOpen] -------------------- LongEntrySignal = ( (Close[1] CrossesAbove BollingerBands(20, 2, Lower)[1]) + (Stochastic(9, 3, 3, Simple, Close/Close, Fast %K)[1] > 20 AND Stochastic(9, 3, 3, Simple, Close/Close, Fast %K)[1] CrossesAbove Stochastic(9, 3, 3, Simple, Close/Close, Slow %D)[1]) + (BearsPower(10)[1] > 0) + (BullsPower(10)[1] > 0) + (HeikenAshi(HAClose)[1] > HeikenAshi(HAOpen)[1]) ) >= 3
ShortEntrySignal = ( (Close[1] CrossesBelow BollingerBands(20, 2, Upper)[1]) + (Stochastic(9, 3, 3, Simple, Close/Close, Fast %K)[1] < 80 AND Stochastic(9, 3, 3, Simple, Close/Close, Fast %K)[1] CrossesBelow Stochastic(9, 3, 3, Simple, Close/Close, Slow %D)[1]) + (BearsPower(10)[1] < 0) + (BullsPower(10)[1] < 0) + (HeikenAshi(HAClose)[1] < HeikenAshi(HAOpen)[1]) ) >= 3
#Long [If-Then, OnBarUpdate, OnBarOpen] --------------------
#If Condition = LongEntrySignal AND SMA(50)[1] > SMA(200)[1] AND ATR(14)[1] > 0.0008
#Then
#ClosePosition Direction = Short
#EnterAtMarket Direction = Long Profit Target = 1.5xATR(14) Stop Loss = 1.5xATR(14) Trailing Stop = 1xATR(14) TS Activation Level = 1.5xATR(14)
#Short [If-Then, OnBarUpdate, OnBarOpen] --------------------
#If Condition = ShortEntrySignal AND SMA(50)[1] < SMA(200)[1] AND ATR(14)[1] > 0.0008
#Then
#ClosePosition Direction = Long
#EnterAtMarket Direction = Short Profit Target = 1.5xATR(14) Stop Loss = 1.5xATR(14) Trailing Stop = 1xATR(14) TS Activation Level = 1.5xATR(14)
#Description This optimized GBPUSD H4 strategy introduces a trend filter, only allowing long positions when the 50-period SMA is above the 200-period SMA, and shorts when the 50-period SMA is below the 200-period SMA. The volatility filter ATR(14) > 0.0008 avoids low-volatility noise. Indicator voting uses updated, faster parameters (Stochastic 9,3,3 and Bulls/Bears Power 10), with 3 of 5 signals required for entry. Exits are tightened to 1.5xATR(14) for both target and stop loss. A 1xATR trailing stop, activated at 1.5xATR, locks in gains on moves. This configuration aims for higher-quality, trend-aligned trades and controlled drawdowns.
Error while running backtest: Error while converting text to strategy - Error: Invalid JSON response from llm: Unterminated string in JSON at position 5405 (line 1 column 5406)
Please authenticate to join the conversation.
In Review
AI Demo
11 months ago

joeleong817
Get notified by email when there are changes.
In Review
AI Demo
11 months ago

joeleong817
Get notified by email when there are changes.