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

MQL5 전문가

작업 종료됨

실행 시간 43 일
피고용인의 피드백
Great customer. Clear instructions. Thanks. Look forward to more jobs in the future.

명시

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.

응답함

1
개발자 1
등급
(27)
프로젝트
43
7%
중재
18
6% / 78%
기한 초과
26
60%
무료
2
개발자 2
등급
(169)
프로젝트
204
30%
중재
25
40% / 44%
기한 초과
12
6%
무료
비슷한 주문
I am looking for a highly sample and ready and tested profitable EA to purchase.if it meets my requirements i will order same one.EA must be low drawdown high profit on any timeframe
i have a ready made SMC EA and looking for optimizing and debugging and also adding back the missing things in the requirement file. Basically work with the current code and refine it to fit the requirement file. Most indicator is already in the EA and the requirement file below are mostly finish. here are the things need to add back and debug based on the requirement file 1. TP from the filter and need to check
If you think you can replicate EA ("reverse engineering") from Metarader's Market, and create a new EA from scratch that works 100% the same - please send an offer. I have already managed to find out many features of that EA (entry times, risk management, averaging, trailing...) but I still miss a few
Candle wick bot The bot will have a set amount of wick length to enter trade at candle open price, there will be a set Amount in points that the candle wick has to be to then enter that opposite of the wick direction Settings will look like this : Timeframe: (meaning which candles you’re using to measure open price from for the wick length ) If set to 5 min it’ll be using 5 min candles , if set to 15 it’ll use 15
Looking for a developer to create an MT4 EA based on a custom currency strength indicator and simple moving average. Will provide currency strength indicator code to the selected developer. Buy rules If the EA added in the EURUSD chart and EUR has a currency strength above or equal to 6 and USD has strength less than 2. Wait for the prices comes back to SMA and open the buy trade if the price closes above SMA. Place
I have an equity reporter. This equity reporter displays the maximum and minimum equity reached over a specific interval. So, if the interval is set to 24 hours, the script will generate data in the format: "Profit ATT" (profit AtThatTime) shows max./min. during the specific interval This specific report shows data in pips. It can also be set to display in price or percentages. The interval is also easily adjustable
Sistema HTF EFECTIVO 30 - 60 USD
Hola, me gustaría que un programador experimentado creea un sistema de trading EA que abra y cierre operaciones muy rápido en segundos (HFT). Sería óptimo tener una opción/botón para activar solo para comprar o solo para vender (operaciones unidireccionales). Con una buena interfaz gráfica de usuario. Se agradece la implementación de su propia experiencia con sistemas de trading HFT. Es para mercados volátiles como
Hello, I would like an experienced programmer to create an EA trading system which opens and closes trades very fast within seconds (HFT). To have an option/button to activate either for only buy or only sell (one way trading) would be optimal. With a nice GUI. Implementing your own experience with HFT trading systems is welcomed. It's for volatile markets such as XAUUSD or US30. Taking advantage of order placements
The strategy is a martingale type . i.e if it hits the stop loss , it will double the lot size and place again in that direction, and when it hits the take profit at any level of the martingale, it will start over from the first lot size used initially
I want you to make me an indicator in Training View. Its idea is very simple, and I want it to have an alarm. Here's a clearer step-by-step guide to checking the last 50 candles on your chart and applying Fibonacci retracement levels based on their colors: Identify Candle Color: Start from the 100th candle from the left on the chart and check its color. If the 100th candle is green (i.e., the close is higher than the

프로젝트 정보

예산
150+ USD
개발자에게
135 USD
기한
에서 1  10 일