Skip to content

About

Trading robot for MetaTrader 5. It trades kangaroo-tail candles at support and resistance zones, with score-based entry filters.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

AdvancedKTTrader

Trading robot for MetaTrader 5. It trades kangaroo-tail candles at support and resistance zones, with score-based entry filters.

Proprietary software. © Teenodi Ltd. All rights reserved. The code is shared for viewing only. It is not licensed for reuse or redistribution. See LICENSE.

What it does

  • Spots kangaroo tails. A kangaroo tail is a candle with a long wick and a small body at one end: a sign that price was rejected. The tail must be a set multiple of the body (TailToBodyRatio).
  • Checks the location. Support and resistance zones are found on their own timeframe, with depth limits and clusters.
  • Scores the setup. In advanced mode, optional checks add up to a score before a trade is taken.
  • Filters the market. Daily 200 EMA trend, higher-timeframe EMA, ATR (volatility), spread, news, trading sessions and daily gain limits.
  • Shows its work. An on-chart panel reports the state of every filter.

AdvancedKTTrader_FIXED.mq5

Inputs

============ MAIN EA SETTINGS ============

Input Type Default Description
MagicNumber int EXPERT_MAGIC Magic Number

============ TIMEFRAME SETTINGS ============

Input Type Default Description
KT_Timeframe ENUM_TIMEFRAMES PERIOD_H1 Kangaroo Tail Timeframe
SR_Timeframe ENUM_TIMEFRAMES PERIOD_H4 S/R Zones Timeframe
UseChartTimeframe bool true Use Chart Timeframe Instead

============ KT DETECTION SETTINGS ============

Input Type Default Description
Kt_Mode KTMode BASIC KT Mode (Basic/Advanced)
TailToBodyRatio double 2.0 Tail to Body Ratio (minimum)
BodyPositionFraction int 3 Body Position Fraction (1/3 of range)
KT_ExpiryBars int 100 KT Expiry (bars)

============ KT OPTIONAL BASIC FEATURES ============

Input Type Default Description
Kt_CandleDirection KTCandleDirection EITHER_DIRECTION KT Candle Type
Preceeding_CandleType KTPreceedingType EITHER_PRECEEDING Preceeding Candle Type
KeepKtVisible bool true Retain past KT on Chart

============ KT ADVANCED FEATURES (Score-Based) ============

Input Type Default Description
Enable_AdvancedFeature1 bool true [1] KT within S/R Zone Cluster
Feature1_ProximityPoints double 10.0 Feature 1: Proximity Extension (points)
Enable_AdvancedFeature2 bool true [2] KT Body within Preceeding Candle Range
Enable_AdvancedFeature3 bool true [3] KT Range >= % of Context
Feature3_PercentThreshold double 50.0 Feature 3: Context % Threshold
Feature3_ContextBars int 20 Feature 3: Context Bars
Feature3_ContextType int 0 Feature 3: Context Type (0=Bars, 1=ATR)
Enable_AdvancedFeature4 bool true [4] KT Tail Tip Absence Check
Feature4_TailPercent double 50.0 Feature 4: Tail % from Tip
Feature4_LookbackBars int 50 Feature 4: Lookback Bars
AdvancedScoreThreshold double 75.0 Advanced Score Threshold (%)

============ DAILY 200 EMA FILTER ============

Input Type Default Description
EnableDailyEMA bool true Enable Daily 200 EMA
DailyEMAPeriod int 200 Daily EMA Period
EnableEMASlope bool false Enable EMA Slope Check
EMASlopeLookback int 5 EMA Slope Lookback

============ HIGHER TIMEFRAME EMA FILTER ============

Input Type Default Description
EnableHigherEMA bool true Enable Higher TF EMA
HigherTimeframe ENUM_TIMEFRAMES PERIOD_H1 Higher Timeframe
HigherEMAPeriod int 200 Higher TF EMA Period
EnableHigherEMASlope bool false Enable Higher EMA Slope
HigherEMASlopeLookback int 3 Higher EMA Slope Lookback

============ ATR FILTER ============

Input Type Default Description
EnableATRFilter bool true Enable ATR Filter
ATRPeriod int 14 ATR Period
ATRMultiplier double 1.5 ATR Multiplier

============ SPREAD FILTER ============

Input Type Default Description
EnableSpreadFilter bool true Enable Spread Filter
MaxSpreadPoints double 50.0 Max Spread (points)

============ NEWS FILTER ============

Input Type Default Description
EnableNewsFilter bool false Enable News Filter
NewsBeforeMins int 30 Minutes Before News
NewsAfterMins int 30 Minutes After News
NewsCloseMins int 0 Close Trades Before News (0=disabled)

============ DAILY GAINS FILTER ============

Input Type Default Description
EnableDailyGainsFilter bool false Enable Daily Gains Filter
DailyGainsMode GainsMode BALANCE_BASED Gains Mode
MaxDailyProfit double 5.0 Max Daily Profit (%)
MaxDailyLoss double 3.0 Max Daily Loss (%)
CloseTradesOnMaxGains bool false Close All Trades on Max Gains

============ TRADING SESSIONS FILTER ============

Input Type Default Description
EnableSessionFilter bool false Enable Session Filter
trade0 bool false 00:00-01:00
trade1 bool false 01:00-02:00
trade2 bool true 02:00-03:00 (Asian)
trade3 bool true 03:00-04:00
trade4 bool true 04:00-05:00
trade5 bool false 05:00-06:00
trade6 bool false 06:00-07:00
trade7 bool true 07:00-08:00 (London Pre-Open)
trade8 bool true 08:00-09:00 (London Open)
trade9 bool true 09:00-10:00
trade10 bool true 10:00-11:00
trade11 bool true 11:00-12:00
trade12 bool true 12:00-13:00 (London-NY Overlap)
trade13 bool true 13:00-14:00 (NY Open)
trade14 bool true 14:00-15:00
trade15 bool true 15:00-16:00
trade16 bool true 16:00-17:00
trade17 bool false 17:00-18:00
trade18 bool false 18:00-19:00
trade19 bool false 19:00-20:00
trade20 bool false 20:00-21:00
trade21 bool false 21:00-22:00
trade22 bool false 22:00-23:00
trade23 bool false 23:00-00:00
CloseTradesAtSessionEnd bool false Close Trades at Session End

============ TRADE EXECUTION SETTINGS ============

Input Type Default Description
SL_Candle SlCandle CANDLE2 Stop Loss Candle (2 or 3)
MarketOrderMaxDistance int 20 Market Order Max Distance (points)
TP_Mode TpMode BY_RR_VS_SL Take Profit Mode
RiskRewardRatio double 2.0 Risk:Reward Ratio
FixedTPPoints double 100.0 Fixed TP (points) - if TP_Mode=Fixed

============ LOT MANAGEMENT ============

Input Type Default Description
UseFixedLot bool false Use Fixed Lot
FixedLot double 0.01 Fixed Lot Size
RiskPercent double 1.0 Risk Per Trade (%)
MaxLotSize double 10.0 Maximum Lot Size

============ MAX TRADES FILTER ============

Input Type Default Description
MaxTradesFilterType MaxTradesFilter BY_TYPE Max Trades Filter Type
MaxTradesPerSymbol int 3 Max Trades Per Symbol
MaxTradesAllSymbols int 10 Max Trades All Symbols (Magic)

============ S/R ZONES SETTINGS ============

Input Type Default Description
EnableZones bool true Enable S/R Zones
DeleteBreachedZones bool true Delete Breached Zones
ZoneVisualisation bool true Zone Visualization
DeleteZoneVisualisation bool true Delete Zone Visualization
MinPreApexBars int 3 Min Pre-Apex Bars
MinPostApexBars int 3 Min Post-Apex Bars
MaxPostApexBars int 0 Max Post-Apex Bars (0=no limit)
ZoneLookBackPeriod int 500 Zone Lookback Period
BodyTipScanRange int 5 Body Tip Scan Range

============ ZONE MIN DEPTH SETTINGS ============

Input Type Default Description
MinDepthMode DepthMode CONTEXT Min Depth Mode (0=Context, 1=Fixed)
MinDepthModeValue double 1.0 Min Depth Value (% or points)
MinDepthContextType ContextType PRECEEDING_BARS_RANGE Min Depth Context (0=Bars, 1=ATR)
MinDepthContextSize int 20 Min Depth Context Size
MinPreApexCloserDepth double 0.3 Min Pre-Apex Closer Depth
MinPreApexFartherDepth double 0.3 Min Pre-Apex Farther Depth
MinPostApexCloserDepth double 0.3 Min Post-Apex Closer Depth
MinPostApexFartherDepth double 0.3 Min Post-Apex Farther Depth

============ ZONE MAX DEPTH SETTINGS ============

Input Type Default Description
MaxDepthMode DepthMode CONTEXT Max Depth Mode (0=Context, 1=Fixed)
MaxDepthModeValue double 3.0 Max Depth Value (% or points)
MaxDepthContextType ContextType PRECEEDING_BARS_RANGE Max Depth Context (0=Bars, 1=ATR)
MaxDepthContextSize int 20 Max Depth Context Size
MaxPostApexFartherDepth double 3.0 Max Post-Apex Farther Depth
ZoneExtension double 5.0 Zone Extension (points)

============ CLUSTER SETTINGS ============

Input Type Default Description
ClusterExtension double 5.0 Cluster Extension (points)
MinZoneCount int 1 Min Zone Count for Cluster
MaxZoneCount int 10 Max Zone Count in Cluster
ClusterExpiry int 0 Cluster Expiry (bars, 0=no expiry)
ClusterVisualisation bool true Cluster Visualization
DeleteClusterVisualisation bool true Delete Cluster Visualization

============ GUI SETTINGS ============

Input Type Default Description
EnableGUI bool true Enable GUI Panel
PanelX int 10 Panel X Position
PanelY int 30 Panel Y Position

Archive

Earlier versions / forks are preserved under archive/ for reference.

Install

  1. Copy the source file(s) into your MetaTrader 5 MQL5/ tree (Experts/, Indicators/, or Scripts/ as appropriate).
  2. In MetaEditor, open the file and compile (F7).
  3. Attach the compiled program to a chart from the terminal Navigator.

Risk note

Trading carries risk. This code shows how the strategy is built. It is not financial advice.

License

Proprietary. © Teenodi Ltd. All rights reserved. The code is shared for viewing only. See LICENSE.

About

Trading robot for MetaTrader 5. It trades kangaroo-tail candles at support and resistance zones, with score-based entry filters.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages