Stochastic + Tendency Channel Strategy correction

Job finished

Execution time 7 days
Feedback from customer
This is the first job I have ever requested and the code provided does what I put in the requirements, I appreciate the effort. Good job.
Feedback from employee
Buen trabajo, gracias por todo.

Specification

The principle for this work is to create a code for MQL5 that uses the stochastic and a tendency channel.


The strategy that is required to be corrected is based on the next:


Buy condition:

1.-  There need to be an uptrend. Mainly in my strategy I use the CHOCH and BOSS (  I didn't programed this on the provided code. ) to determine in which direction is the price going and I mark a tendency channel using the 2 maximum values and 2 minimum values. If it matches with more maximum and minimum levels that’s better. See the example in the images added.

2.- The Stochastic shows a cross between %K and %D, where %K crosses from bellow to above %D, making a condition similar to this:

(KValue0 > 20 && DValue0 > 20 && KValue0 > DValue0 && KValue1 <= DValue1 && KValue2 < DValue2) And (KValue0 > 20 && DValue0 > 20 && KValue0 > DValue0 && KValue1 >= DValue1 && KValue2 < DValue2)  See the example in the following slides.

3.- The price should be between the lower and middle lines of the tendency channel.

Sell condition:

1.-  There need to be an downtrend.

2.- The Stochastic shows a cross between %K and %D, where %K crosses from above to bellow %D, making a condition similar to this:

(KValue0 < 80 && DValue0 < 80 && KValue0 < DValue0 && KValue1 >= DValue1 && KValue2 > DValue2) And (KValue0 < 80 && DValue0 < 80 && KValue0 < DValue0 && KValue1 <= DValue1 && KValue2 > DValue2)  See the example in the following slides.

3.- The price should be between the upper and middle lines of the tendency channel.


The position should be opened with the following:


Sell position:

-The STP (Stop Loss) should be 3 points bellow the lower minimum of the previous 4 candles.

-The TP (Take Profit) should be 2 times the distance of the STP – Actual Price. Example: STP=15+3 , TP= (15+3)*2=36

Sell position:

-The STP (Stop Loss) should be 3 points above the higher maximum of the previous 4 candles.

-The TP (Take Profit) should be 2 times the distance of the STP – Actual Price. Example: STP=15+3 , TP= (15+3)*2=36


I require that if the account loss 1.5% of its total, stop the tradings and notify me via email. Example: the account started the day with 10000 dlls, and 13 hours after it losses 150 dlls it stops


Note: In the documents I added a code I was working in to try and do these things, please check it and tell me if it can be reworked or what can we do.
Also I added some lines to prevent the opening of operations 2 or 3 candles after one was opened and other lines to close the positions when the conditions where met.

Please use these conditions or some similar to do the same. 



The code I provided does the following:

1.- It calls the stochastic, EMA and MACD indicators (the last two are for trend identification, if you have a better way to detect trends be free to modify it or improve the conditions)

2.-Creates a tendency Channel using the all the candles in the screen but it may or may not be the better way to adapt to the strategy described above, becouse the channel does not identify the changes of tendency that fast.
3.- Open and close orders, but it a lot of times does not open a position even if the conditions are met, so the code needs help there, and sometimes it does not open the correct type of order, so I changed the order type from buy and stop to buy stop and sell stop.

4.-It prevent the opening of operations 2 or 3 candles after one was opened and other lines to close the positions when the conditions where met.

5.- I added an example for the price detection of highest high and lowest low at the end of the code, but i couldn't implement the operation to obtain the correct value for TP (2 times the STP distance)

The examples I used were the basic ones, I don’t know a lot of ways to do a trading code since I am a Mechatronic Engineer and I don’t know a lot of the things of the MQL5 language. If you know a better way to do the code feel free to tell me.


If you require more examples of the strategy that I explained on top and shown on the images or need more details please notify me.


Responded

1
Developer 1
Rating
(45)
Projects
46
24%
Arbitration
34
9% / 85%
Overdue
10
22%
Free
2
Developer 2
Rating
(72)
Projects
80
10%
Arbitration
38
8% / 58%
Overdue
6
8%
Free
3
Developer 3
Rating
(85)
Projects
169
44%
Arbitration
3
67% / 0%
Overdue
5
3%
Working
Published: 1 code
4
Developer 4
Rating
(130)
Projects
184
32%
Arbitration
18
28% / 67%
Overdue
27
15%
Free
Published: 1 code
5
Developer 5
Rating
(206)
Projects
333
35%
Arbitration
66
12% / 58%
Overdue
87
26%
Free
6
Developer 6
Rating
(19)
Projects
31
32%
Arbitration
8
50% / 25%
Overdue
3
10%
Working
7
Developer 7
Rating
(4)
Projects
2
0%
Arbitration
2
50% / 0%
Overdue
0
Free
8
Developer 8
Rating
(4)
Projects
6
0%
Arbitration
5
0% / 80%
Overdue
2
33%
Free
9
Developer 9
Rating
(296)
Projects
475
40%
Arbitration
105
40% / 24%
Overdue
80
17%
Busy
Published: 2 codes
10
Developer 10
Rating
(77)
Projects
243
74%
Arbitration
7
100% / 0%
Overdue
1
0%
Free
Published: 1 article
11
Developer 11
Rating
(69)
Projects
146
34%
Arbitration
13
8% / 62%
Overdue
26
18%
Free
Published: 6 codes
12
Developer 12
Rating
(144)
Projects
186
41%
Arbitration
24
58% / 21%
Overdue
13
7%
Free
Similar orders
Mk 30+ USD
I need a fully automated trading robot designed to generate consistent profits while strictly controlling risk and minimizing losses. The robot should use a combination of strategies, including trend-following, scalping, and price action, and must be able to adapt to different market conditions such as trending and ranging markets. It should analyze the market using indicators like Moving Averages, RSI, MACD, and
Seeking developer service to code an EA. Interested developer must have good experience and understanding on how ORB and FVG works, and agreed to the terms below : 1. Shall demonstrate a fully functional EA that operates as specified in the requirement and function automatically as requested in real-time environment (forward test - demo/live), regardless of good results obtained in strategy-tester. Backtesting
Need trading robot 50 - 70 USD
I need a robot for trading gold and currencies . I need to use it with metatrader 4 and 5 . My budget is not high . Max . 70 USD. I need to be able to start and stop it at any time without restrictions
am looking for an experienced MQL5 developer to build a high-frequency trading Expert Advisor (EA) for XAUUSD (Gold) on M1 and M5 timeframes . The EA must include advanced execution logic, dynamic pending orders, risk management, and news/session filters. Clean, efficient, and well-documented code is required. Strategy type: Scalping (fast trades, quick profit). Very fast execution logic (optimized for speed). Goal
Title: MT5 EA Needed – Prop‑Firm Compliance Tool (SL/TP at Entry, 60‑Second Hold, Daily Profit Cap, 0.5% XAUUSD Risk) Description: I need an MT5 Expert Advisor that enforces prop‑firm compliance rules for Instant Funding accounts. The EA must NOT trade automatically — it should only monitor and control my manual XAUUSD trading. I trade all sessions, so there should be no time restrictions. MY TRADING STYLE (Important
​1. Project Overview ​ Asset: XAUUSD (Gold) ​ Timeframe: M1 (1-Minute) for execution; M5/M15 for trend filtering. ​ Objective: Execute high-frequency scalps during peak liquidity (London/NY overlap) to capture 10–30 pip movements with high precision. ​ Core Logic: The "Poverty Bot" strategy relies on Mean Reversion combined with Momentum Burst (Price Action + RSI/EMA filters). ​2. Strategy Logic (The "Poverty"
Simple MA indicator with buy and sell arrow with a push notification. Conditions for buy or sell should be when price breaks above or below the MA and then retraced back to the MA creating a HH/HL or LH/LL then the buy/sell signal arrow should be at the reversal candle that forms the HL/HH. And on indicator window1 RSI cross over MA and the RSI line
I need any highly profitable robot which can trade small account like 50-100USD and any currency pair(s) The robot should avoid trading around news time and have good risk management. It should use any strategy which is profitable and not those unacceptable by brokers. Demo versions will be required before selection
I need a high-speed Expert Advisor (EA) for MT5 designed specifically for XAUUSD (Gold) scalping. The bot should focus on fast entries and quick profits with high efficiency. Main requirements: 1. Symbol: XAUUSD (Gold only). 2. Platform: MetaTrader 5. 3. Strategy type: Scalping (fast trades, quick profit). 4. The bot should open trades frequently based on fast market movements. 5. Small Take Profit (quick profit
Gold_m1_ob_bot. 30+ USD
import MetaTrader5 as mt5 import pandas as pd import time from datetime import datetime # ================== CONFIG ================== SYMBOL = "XAUUSD" TIMEFRAME = mt5.TIMEFRAME_M1 LOT = 0.01 MAX_OBS = 12 # keeps signals frequent ATR_PERIOD = 14 IMPULSE_FACTOR = 1.5 # strong candle = impulse SESSION_START = 8 # GMT (London open) SESSION_END = 20 # GMT (NY close) MAX_SPREAD = 30 #

Project information

Budget
30 - 70 USD
Deadline
to 15 day(s)