Skip to content

athalbrandr92/Trading

Repository files navigation

Institutional-Grade cTrader Algo Suite 📈 A complete, open-source algorithmic trading suite for cTrader, designed specifically for passing and managing Proprietary Trading Firm evaluation accounts

⚠️ IMPORTANT DISCLAIMER ⚠️ This is not a magical ATM. These algorithms are highly surgical breakout and trend-following tools. They are designed to strictly limit drawdown and protect equity. If you disable the risk management parameters, crank your leverage to maximum, and run this without proper genetic optimization for your specific broker's spread, you will blow your account. Use responsibly, optimize on quality tick data, and test on a demo account first.

🛠️ The Components This repository contains three main components: one master indicator and two fully automated cBots.

  1. DynamicSnRBoxes (Indicator) This custom indicator acts as the structural foundation for the bots, automatically drawing Support and Resistance zones based on true market structure rather than lagging averages.

Major Zones: Multiday Highs/Lows, Institutional Order Blocks, and "Century" psychological levels (e.g., flat $100 marks on Gold).

Mid Zones: Daily Highs/Lows, "Half-Century" psychological levels, and Double Tops/Bottoms.

Minor Zones: Nearest session Highs/Lows to current price, "Quartile" psychological levels, and generic consolidation zones.

  1. Range Breakout (cBot) A time-based volatility algorithm. It calculates the opening range based on your specified trading start time and lookback period.

Execution: Enters trades only when price breaks out of the defined range with a strict confidence threshold.

Management: Features 3 Take Profit methods (plus an optional "Trailing Only" infinite-runner mode) and 4 distinct trailing Stop Loss methods.

Smart Exits: Automatically closes trades upon rejection from the DynamicSnRBoxes zones to secure profit before a full reversal. (Note: A toggle to optionally disable this feature is planned for a future update).

  1. Wave Rider (cBot) A structural trend-following algorithm that actively trades the price action between the zones generated by the DynamicSnRBoxes indicator.

Execution: Takes entries based on either a confirmed zone breakout or a high-probability zone rejection.

Filters: Includes optional EMA, ADX, and MACD overlays to ensure the bot only trades when momentum agrees with the structure.

🛡️ Key Features & Prop Firm Safety Unlike standard open-source bots, this suite is heavily engineered around survivability and passing strict prop firm evaluations.

The "Holiday Blackout" Shield Liquidity vanishes between late December and early January, leading to massive spread blowouts and phantom price spikes (such as a 400-point single-tick spike on XAUUSD last year). Both bots feature a hardcoded holiday blackout filter (Dec 20th - Jan 5th) to automatically sideline your capital during these highly dangerous, low-liquidity periods.

Dynamic % Risk Management Stop sizing your lots manually. Both bots calculate true risk as a strict percentage of your current account balance, ensuring your downside is always mathematically capped regardless of how wide the structural Stop Loss needs to be.

The Prop-Firm Fitness Function If you use cTrader's built-in genetic optimizer, these bots override the default scoring system with a highly complex custom GetFitness function designed to find smooth, safe equity curves.

The Math: (Recovery Factor * Profit Factor * Win Rate * R-Score * Log10(Total Trades) / Max Equity DD %) * Net Profit % * R-Score

The Drawdown Penalty: The algorithm violently penalizes reckless parameter sets. If a backtest exceeds a 5% maximum drawdown, its fitness score is slashed in half. If it exceeds 10%, the score is divided by the drawdown percentage itself, throwing the parameter set into the trash.

Trade Count Scaling: Penalizes parameter sets that don't take enough trades (curve-fitting) and applies hyperbolic or linear decay to sets that over-trade (commission bleeding).

⚙️ Usage & Optimization

Assuming you already have cTrader installed, download the Sources folder. Go to your My Documents. Double click into cAlgo. This is where you should place the Sources folder. You will presumably not already have a bot or indicator by the same name as mine and it should go smoothly. If it does not, either you are updating and should replace all or you have named some files the same things as I have named mine. Shoot me an email marked high priority to athalbrandr92@gmail.com if you can't get hold of me on here. May add my Facebook info later.

Always optimize for your specific broker's spread and timezones using cTrader's genetic optimizer. Adjust the hardcoded 5% and 10% drawdown penalties in the code to match your specific prop firm's daily and maximum loss limits. There is a more heavily detailed README for optimization and even that one needs another go at going in depth with the full process. It isn't a complex system to set up and it isn't complex to understand, it just has a lot of steps and a lot of the steps are repeats of lower levels and even repeats of lower levels with particular portions added or removed. That's why it may take some time for the full instruction manual to come out.