Part of a code to implement in my EA

Trabajo finalizado

Plazo de ejecución 5 horas
Comentario del Ejecutor
Great customer. and thanks for help.
Comentario del Cliente
Very good programmer and fast!

Tarea técnica


Hello, 

I need a code to implement at my EA. 

Make sure you got every detail of the code and do not hesitate to contact me.

When my EA will call this function ( "int Moment()" ), the result of the code should be: +1 for UP trend, -1 for DOWN trend and 0 for NEUTRAL.


The following should be the parameters inputs:

input group             "MA"
input ENUM_TIMEFRAMES      MA_TimeFrame        = PERIOD_CURRENT;   // MA: TimeFrame
input int                  MA_Period     = 20;          // MA: Averaging Period
input int                  MA_Shift      = 0;           // MA: Shift
input ENUM_MA_METHOD       MA_Method     = MODE_SMA;    // MA: Smoothing Type
input ENUM_APPLIED_PRICE   MA_Applied_Price = PRICE_CLOSE; // MA: Type Of Price
input group             "VOLUME"
input ENUM_TIMEFRAMES      VOL_TimeFrame        = PERIOD_CURRENT;   // Volume: TimeFrame (Must be equal to MA TF).
input ENUM_APPLIED_VOLUME  Vol_Type       =   VOLUME_REAL;    // Volume: Type
input group             "GENERAL"
input int                  CalculateBars           =     300;     // Bars To Calculate
input int                  Moments_Average     =     20;      // Average of the Volume Moment


The function will calculate up to "x" last bars (CalculateBars = 300).

Every time 02 sequence bars (i and i+1) close (close price) above the MA trend line, it will initiate a new "moment" (UP trend), until 02 sequence bars close below MA trend line and initiate a new "moment" (DOWN trend this time).

So, when 02 sequence bars close above the MA trend line, the function will start to calculate the following data:

1) How many points is the diference between the value of the close price of the first bar of this "moment" and the close price value of the last bar. (Should be in points and always positive value) - "mov_distance"

2) The sum of the volume (real or tick) of all the bars that compose the "moment". - "vol_sum"

3) The result of the division from the sum of the volume and the distance of the bars movement. - "power = vol_sum / mov_distance"

This function will calculate it until the next 02 sequence bars close below the MA trend line.

When it happen, it will initiate a new "moment", but this time it will be a down trend. PS: Remember the "power" result must be always a positive value, because the "mov_distance" should be the result in points.


As we are calculating the last x bars (300 for example), it should happen a lot of mixed "moments" of up trends and down trends.

For each "moment" of this, the function code will save the results ("power") separately.

After that, it will calculate the average of all moments results. "Moments_Average". 


Now, the last part is:

If the value of the current "moment" is greater then the "Moments_Average", it will return +1 for up trend and -1 for down trend.

If the value of the current "moment" is minor of the "Movements_Average", it will return 0.

Han respondido

1
Desarrollador 1
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
2
Desarrollador 2
Evaluación
(74)
Proyectos
121
43%
Arbitraje
12
33% / 50%
Caducado
17
14%
Libre
3
Desarrollador 3
Evaluación
(20)
Proyectos
28
7%
Arbitraje
0
Caducado
3
11%
Libre
4
Desarrollador 4
Evaluación
(2422)
Proyectos
3042
66%
Arbitraje
77
48% / 14%
Caducado
340
11%
Trabaja
Solicitudes similares
preciso de um robô com duas médias móveis, uma exponencial high e uma exponencial low. preciso também ter a opção de utilizar e todos os tempos gráficos e alterar os parâmetros das médias. entrada de compra será feita quando um candle de alta romper e fechar a cima da média high e fechará a posição quando um candle de baixa romper e fechar a baixo da média low. a venda será feita quando o candle de baixa romper e
Description - An expert advisor(s), placing sell trades in EUR/USD, based on the close price of the previous two candles, as shown in the figure below. The trades would be made in the 5 minute, 1 hour, and 1 day timeframes. In the 5 minute and 1 hour timeframes the market orders would be placed at the start of a new candle, at specific times EST. The order would be cancelled at the close of that candle, i.e after 5
Greetings, As the title suggests, I am trying to convert an indicator that calls itself via an iCustom call like this. iMAArray_Buffer[loop_1] = iCustom ( NULL , Selected_TF, MQLInfoString ( MQL_PROGRAM_NAME ), "calculate" , RPeriod, MType, MPeriod, 1 , shift); Full code will not be provided, only the position that needs fixing. I cannot get this working in MQL5 but the original code runs smoothly in MQL4. Please
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
Greetings great developer, I am in search of a highly skilled developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Greetings great developer, I am in search of a highly skilled MQL5 developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Hi, I need a robot, which wil get instructions to trade in 3 symbols at the same time based on few parameters and calculations. Example: There is 1 symbol called Gold-Near and the rate for it is 1000-1002 If i specify that when the rate reaches 1050, it should sell 1 lot Upon execution it will have to sell 1 lot of cme gold, buy 3 lots of mcx gold and buy currently (lots will be based on calculation). All the
Trading bot 300+ USD
We need bot that trades when medium and low impact news hits It will release pending order both directions few min prior to news impact And will have certain risk management strategy attached Example If Monday and Tuesday news successful clears profits It will reduce risk for next news events until new week starts each week message on tg: Dstatewealthtrading NOTE: 4 YAERS OF EXPERIENCE UPWORD, YOU MUST BE A
I need someone the create a supertrend indicator based on Heikin Ashi candles instead of normal candles. Needs to be exactly the same as the supertrend (original one) + ha from tradingview. In m1,m5,m15 the indicator must have the same values ​​found with the tradingview. Work that meets this requirement will be accepted ( depending on the broker and spread, however, a few pips of difference will be accepted)

Información sobre el proyecto

Presupuesto
30 - 60 USD
Para el ejecutor
27 - 54 USD
Plazo límite de ejecución
a 1 día(s)