Description
Note: check the bot in optimizer and choose the best as per your requirements.
The optimizer give you the best time frame and parameters to trade.
You can choose with other Items like BTCUSD..etc
This C# code is for a cAlgo robot designed to execute trades based on a moving average crossover strategy. Here's a breakdown of its key components:
Parameters:
- FastMAPeriod: Specifies the period for the fast moving average.
- SlowMAPeriod: Specifies the period for the slow moving average.
- RiskPercentage: Sets the risk percentage per trade.
- ATRPeriod: Sets the period for calculating the Average True Range (ATR).
- TakeProfitATRMultiplier: Multiplier for calculating the take profit level based on ATR.
- StopLossPips: Sets the initial stop loss in pips.
- AdditionalStopLossPips: Sets an additional stop loss level in pips.
- MaxStopLossThreshold: Sets the maximum stop loss threshold in pips.
- MaxLotSize: Specifies the maximum lot size for a trade.
- MaxEquityDrawdown: Sets the maximum equity drawdown allowed as a percentage.
- AllowMultipleOrders: Determines whether multiple orders are allowed to be opened simultaneously.
Initialization:
- The robot initializes its moving averages (fastMA and slowMA) and sets initial values for variables like maxLotSize, maxEquityDrawdown, and peakEquity.
- It checks for an expiry date and stops trading if the current date exceeds it.
OnTick():
- This method is called on every tick (price update).
- It calculates the drawdown percentage based on peak equity and pauses trading if the drawdown exceeds a predefined threshold.
OnBar():
- This method is called on every new bar (candlestick).
- It checks for open positions or pending orders and exits if any exist.
- Calculates risk amount, ATR, and stop loss distances.
- Executes buy or sell orders based on moving average crossover, with appropriate stop loss and take profit levels.
- Pauses trading if stop loss exceeds the maximum threshold.
Helper Methods:
- IsBullishMarket() and IsBearishMarket(): Determine market sentiment based on open and close prices.
- CalculateATR(): Calculates the Average True Range.
PauseTrading():
- Method to pause trading when maximum drawdown is reached.
This robot aims to automate trading decisions based on a simple moving average crossover strategy while incorporating risk management techniques like stop loss and maximum drawdown control.
Indicators():
- FastAndSlowMovingAverage.
- AverageTrueRange.
Please download the Indicators as well. Check the instruction how to activate the indicators for BTCUSD5 and XAUUSD 5m Bot.
AverageTrueRange algorithms.types.indicator.name | Algorithmic Forex Trading | cTrader Community
Note: the Bot is for free until 12.06.2024
Test it in demo ctrader account, I have passed many funded accounts in 2 to 3 days with this Bot.
This bot is working with 2x indicators which I made.
Any question please don't hesitate contact me shapor33@gmail.com
Note: I have tested XAUUSD 5m around 6 months with this bot, BTCUSD test is not done yet, I prefer that use only for XAUUSD 5m, avoid the bot activation during the news major affect, try to pause the both during the major news impact.
How to activate the indicators
Indicataors
Parameters: you can put your choice, but my prefer is do as per the below.
The author decided to hide the source code.
shapor33
Joined on 08.04.2024 Blocked
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Arian Bot XAUUSD 5m BTCUSD 5m 1month trail bot.algo
- Rating: 0
- Installs: 299
- Modified: 12/05/2024 18:19
Comments
Great! Than use XAUUSD 5m and adjust the parameters as per your need.
This bot uses martingale?
Thanks, in going to try to pasa challenge 10k TFF
I will modify the bot to stop the trade during the news to avoid any losses for the whole mont…..
I have been running this bot last three days, and until today not triggered a single trade.