Hi dev,
I want to code a MQL5 EA as described below.
I can provide my custom tradingview pinescript v5 code as a reference.
*** Strategy description ***
The strategy looks for a specific 4 candle pattern to open long or short.
Current candle is candle 0, previous candle is 1 and so on.
For longs: Current candle closes above previous candle’s high (candle 1) and also closes above candle 3 high.
For shorts: Current candle closes below previous candle’s low (candle 1) and also closes below candle 3 low.
The candle pattern is only valid on bar close.
*** Entry conditions ***
Once a pattern is detected we will stop looking for new patterns until the trade is closed or cancelled. If the limit order is not triggered in X number of candles we cancel the limit order and restart looking for candle patterns. If before the trade is triggered we get a contrarian signal we also cancel the trade and open the last one to appear.
Here is the candle detection code in pinescript V5:
bool greenTriangle = close > high[1] and close > high[3] and not prevGreenTriangle
bool redTriangle = close < low[1] and close < low[3] and not prevRedTriangle
When the pattern is detected a limit order is set to X pips above the last candle for longs or under for shorts. This makes sure that the trade will only open if the price actually moves in the direction of the signal. If the price moves in the opposite direction we will end up canceling the order after X candles or a contrarian signal.
That’s all for the trigger conditions.
*** Exit conditions***
For exit we use a fixed stop loss value equal to X pips and a dynamic take profit that is a multiplier of the ATR value (period 7 candles and multiplier 0.7 for instance).
An open position should also be closed if we get an opposing candle pattern.
*** Position size ***
In terms of position size we risk losing 1% of the account per trade. If this results in a value bigger than the whole account we use 90% of the account as position size.
The strategy only keeps one long or one short open per time so there is no pyramiding.
It should be possible to define two time periods for opening trades per day. For instance from 08h00 UTC to 12h30 UTC and again from 14h30 UTC until 21h00 UTC.
Closing trades can be anytime since we defined the stop loss and take profit already.
We should have an icon indicating a long and one for short. Position entry price, stop loss and take profit should also be displayed.
Please see attached image for an idea of what it should do.
Thanks
相似订单
Hello developers, I’m looking for a professional trading bot that works using pending orders only (Buy Stop & Sell Stop). Main requirements: The bot must open multiple pending orders continuously. Stable execution without freezing or missing orders. Clean and professional logic suitable for real trading. Fully customizable settings (distance, lot size, TP/SL, trailing, etc.). If anyone already has a ready-made
Develop a fully automated MT5 Expert Advisor based on a multi-timeframe institutional trend-pullback strategy with: Regime filtering (H4) Execution logic (H1) ATR-based stop model Multi-stage trailing system Risk-based position sizing Portfolio-level risk protection Detailed performance logging This EA will be used for client capital (PAMM/MAM environment). Stability and risk control are higher priority than high
The EA should only set TP and SL( Both Optional, We can set one at the time or no one at the same time or both active at the same time) 1. We active trade ourself , But in The EA this should ask if what the the TP and SL in form of USD we need. We'll put the Exact Required profit and or loss. This EA should calculate and set the tps and Sls itself to all the trades, and when we change the USD profit from info meter
Hello, I have an MQ4 indicator that works with a specific strategy. I want to modify some aspects and convert the file to MQ5. It's simple and won't take much effort or time for someone experienced in this field. Ideally, the person undertaking this task should be familiar with the MX2Trading software, as I will be using it to transfer the signals from the indicator to the trading platform
I trade manually on M1 chart (XAUUSD) with fractals and alligator. When there is a price break on fractal (or some fractals that form a price level) or a price level created by multiple candles spikes, I enter 2 trades (0.02 lots), and 2 trades (0.04 lots). If I go in profit (5/10€), I close in profit. But if I go in loss with DD, at this point starts the management: every price level (important level) created by
99.99% signal accuracy 10-15 trades distribution all currency trade and meta AI assistance on loss[advice] stop and start robot cyber security firewall protection activation code: 20060605TLP20 Please create a trading bot with any logo with the name elevation
Refine signal trigger execution . Optimize live chart performance . Ensure stable and clean code structure : Stable and clean code is important . Otherwise its a mess . Apply with as much accurate structure you foresee
50 EMA > 200 EMA → Uptrend confirmed Price pulls back to touch or cross below 50 EMA RSI > 50 ATR(14) > 20-period ATR average (volatility expanding) Current candle closes bullish ➡ Enter BUY at candle close50 EMA < 200 EMA → Downtrend Price pulls back to touch or cross above 50 EMA RSI < 50 ATR filter confirms volatility Current candle closes bearish ➡ Enter SELL at candle closeATR(14) Take Profit: 2.5 × ATR(14) This
This post is subject to developers response . Edit the post as you like . May be with me you can make a come back . So , , , Shift calculations . More to the calculation then you can comprehend is known . What else comes to your mind
Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package. 1. The idea of the trading system is as follows: market entries are performed when MACD's main and signal lines intersect in the current trend direction. 2. Trend is determined based on the Exponential Moving Average with the specified period