Class-driven Averaging Subroutine - position averaging function, opening positions against the trend

MQL5 Experts

Tâche terminée

Temps d'exécution 43 jours
Commentaires de l'employé
Great customer. Clear instructions. Thanks. Look forward to more jobs in the future.

Spécifications

Develop a class-driven sub-routine that can be implemented in a variety of existing Expert Advisor with minimum complications of integration. It should implement a good OOP concept for reusability and derive sub-mechanisms.

This sub-routine will work on algorithms running on MT5 terminal; we may need to develop an expert advisor opening a long or short position for test. This subroutine purpose is to implement a strategy of averaging down.

This is that we open:

BUY 1 LOT EURUSD at 1.19209

This sub-routine will open automatically

BUY 1.3 LOT EURUSD at 1.19172 with a comment "Level_1"

Resulting on an average price in EURUSD of 1.19195 at 2.30 LOT, so this sub will draw a BLUE line at this average level. RED if SELL position.

Attention: For different LOT of positions, the average price is calculated using a mathematical formula.

Finally, will open automatically if the price continue against:

BUY 1.69 LOT EURUSD at 1.19078 with a comment "Level_2"

This next average level as is not open yet so will draw a line in "Bisque" color with the parameters of the averager sub-routine in this case the LOT factor increases to a 30% or 1.3X and the amount of PIPs in the following format:  1.30X/1.69N/94p indicating the average %, resulting lot size and pips in distance.

If this average level is triggered then the average price of the EURUSD position is 1.19145 at 3.99 LOT.

The PIPs difference between 1.19209 and 1.19172 and the next 1.19145 is provided as a parameter for the sub-routine.

The averager sub-routine will have a maximum amount of positions to open. And a FLOOR parameter that sets the minimum distance, this distance can be set in price or points. If in the example below we set a price floor of 1.19130 the next level provided can not be 1.19145 and will be floored at 1.19130. If we set a points floor of 70 pips the next level can not be 67 pips as provided and will be floored at 70 pips.

The subroutine will increase distance in the same way to increase volume, this is that an increment can be set of a 10% or 1.1X added to the distance provided.

If the instrument maximun volume is 50, and the next average down is 56. We will fraction the order in 50 (the max.) and another position at the same price level at 6, with the same comment. If the broker have a maxium limit of positions and can not open, we will pop-up a message alterting with the limitation of opening new positions. 

Finally, the sub-routine will use a time delay to evaluate if a different distance in pips is supplied.

Inputs:

AveragerFunc(
             bool AverageUSE=true,
             int Distance=1,
             ENUM MinDistType=1, //1-Price, 2-Points
             double MinDistVal=0,
             bool UseCalcDelay=true,
             ENUM CalcDelay=1M, //1M,2M,5M,15M,1H,1D,1W, TF defaults in example
             DistanceFactor=1.1, //points + 10% in this case
             LotsFactor=1.3, //volume + 30% in this case
             MaxOrders=10, //maximum of averaging positions
             string s="Averager " //default comment for opening positions and concatenate
             )

Output of the subroutine will be:
LOTs BUY:        2.3             //actual volume size
LONG Avg:       1.19195       //actual average
LONG N Avg:    1.19145       //next average

The average calculation have to take into account any commission and swap charges in any given period. So if this positions stays for more than a day and a swap is charged, have to be reflected in the resulting average price every day.

Attached an image of the horizontal lines.

Répondu

1
Développeur 1
Évaluation
(27)
Projets
43
7%
Arbitrage
18
6% / 78%
En retard
26
60%
Gratuit
2
Développeur 2
Évaluation
(169)
Projets
204
30%
Arbitrage
25
40% / 44%
En retard
12
6%
Gratuit
Commandes similaires
Just have a let down by previous coder. (Andrii) please dont apply for this one. Coder with low Metrix please dont apply : High Arbitrage/Low reviews/High Overdue I will just avoid This is a long-term Project You ll have to continue work on the source file done so far, there might be bug to fix and continue the work as needed. What be involve: Grid system Dashboard Indicaotor Addon Setting/Logic enhancement News
Experts mt5 30 - 50 USD
I need a programmer to create an MT5 robot, putting my strategy inside it, send me a message if you are interested! The robot will be based on averages making purchases and sales together
To develop EA algo on GBPUSD on MT5 Client will provide the necessary indicator which will plot Daily pivots on the chart. PFA screenshot attached for details of job work
Hello, my budget is 30$, I need MT5 EA send alert to telegram: 1. Send alert if any position volume by magic number more than: for example, 0.25 lot, send position symbol name and positions not all positions just the positions are more than 0.25 lot volume and positions trade comment and send Custom comment: I entered it manually in input menu. 2. Send alert if I have open positions by magic number in
Description de la stratégie de trading : Bot de trading ULTIMATE AI Smart Money Concept (SMC) Aperçu: J'ai besoin du robot de trading IA ultime, conçu pour mettre en œuvre une stratégie de trading Smart Money Concept (SMC) axée sur l'identification des configurations de trading à forte probabilité en fonction de la structure du marché, des blocs d'ordres et de l'évolution des prix. Ce robot vise à capitaliser sur le
I’m looking for a skilled MQL5 developer to build an MT5 Expert Advisor that mirrors inverse trades (Buy ↔ Sell) from a prop firm challenge account (demo) to a live hedge account . Core Requirements: Open and close opposite trades in real-time Dynamic lot sizing based on account balances (Objective: recover approx. $500 if the challenge account fails) Support for multiple symbols , including: XAUUSD, NAS100, BTCUSD
Hi, I’m looking for an experienced MQL5 or AI trading systems developer who can build a scalable, beginner-friendly forex trading network . The system should include: Fully automated trading logic (AI-enhanced or rule-based) MT5 (or MT4 if needed) compatibility A beginner dashboard with simplified controls A structure that supports onboarding of multiple traders (eventually multi-asset) Key modules like performance
Trading Strategy Description: ULTIMATE AI Smart Money Concept (SMC) Trading Bot Overview: i need The ULTIMATE AI trading bot that is designed to implement a Smart Money Concept (SMC) trading strategy that focuses on identifying high-probability trading setups based on market structure, order blocks, and price action. The bot aims to capitalize on institutional trading behavior by analyzing price movements and
I need someone who can provide metatrader4/5 restful api. And I want restful and websockets. we need to use metatrader api in our app for statistics and trade copying. Apply only if you have the necessary qualifications and experience for this project
I need a highly disciplined, low-risk EA for MT4/MT5 that trades only when 100% strategy conditions are met. It must include multi-timeframe trend logic, support/resistance rejection, BOS/CHoCH detection from real swing levels, and a breakout strategy with trailing SL. EA should scan all major pairs (from one chart), trade only during 07:00–16:00 GMT, and skip trades 2 hours before major news. Max 1 trade per pair

Informations sur le projet

Budget
150+ USD
Pour le développeur
135 USD
Délais
de 1 à 10 jour(s)