Grid | Hedge | Martingale with TrailingStop

MQL5 Experts Forex

Termos de Referência

Hi! Below is the explanation of the EA together with an example in image. I attached a TrailingStop and TrailingStep code as references that I have been using on another EA. The PDF file contains the same description, but with some expected inputs as example.


Explanation:

1) The EA strategy is summarized in opening up to 20 multiple positions according to each range of points reached in the opposite direction of the operation (Grid when activated by bool input), and closing with profits according to the values ​​of Trailing Stop / Trailing Step.


2) The lot of each position (1st to 20th) will be different and should be informed in the input (20 lots inputs)

 

3) The interval /range in points to open the next grid position must be informed in the input, and it will be different for each position (20 interval inputs)

 

4) The exit of a position with a profit will occur through the “TrailingStopProfit” with “TrailingStepProfit”, which will be activated with each new position of the grid as soon as the current price (long position example) is above the sum of the calculation:

a) "Average Price / Breakeven*" of the operation +

b) a value in pips informed in the input called "ProfitZone" +

c) the sum of the entry and exit commissions so far according to the lots (commission amount per 1 lot will be entered via input to be calculated by the EA).

 

5) Aiming to reduce the risk, I must inform from which position I want to exit with less profit (“StartSecureZoneAtPosition”). In the chosen position of this input and next positions of this grid the exit will be through value of “TrailingStopSecure” with “TrailingStepSecure”, which will be activated when the current price (long position example) is above the sum of the calculation:

a) "Average Price / Breakeven*" of the operation +

b) a value in pips informed in the input called "SecureZone" +

c) the sum of the entry and exit commissions so far according to the lots.

 

6) Date / Time Filter: It must be possible to specify the days of the week and time to make the entries, for example: Monday to Thursday from 2AM to 8PM (“EachDay” at those times – bool option) or Monday from 2AM to Thursday 8PM (“NonStopDay” bool option). To avoid having an open position on the weekend, if there is a trade in progress and the option (input bool) "ForceCloseAll" is "true", all paper trades must be closed at once at the specified time and day (Ex : ForceCloseAllDay = "Friday"; ForceCloseAllHour = 9)

 

7) Spread filter: maximum spread in pips (“MaxSpread”) acceptable to open the first position.

 

8) As for the entry of operations, that is, the 1st trade, it can be done in two ways:

 

a) By the Expert Advisor:

BUY: The closing of the previous candle is greater than the maximum of the last N candles (“Ncandles”).

SELL: The previous close is less than the minimum of the last N candles (“Ncandles”).

or

b) Manually:

With the EA active on the chart, I will add a pending order on the paper with the initial batch (One click trading or other method), and as soon as the order is executed the robot will follow up with the trailing for profit or grid for the next order ( 2nd) and others.

 

9) The robot can be used on assets/currencies with different decimal places (such as EURUSD “1.45120”, USDJPY “115.120” and assets without decimal places “265”).

 

10) If the operation reaches position 20, trades must be closed at the loss as soon as it reaches the next range specified in the input (Position 20 + “Range21Close”).

 

11) A “Complete Operation” means a trade that has been completed by Trailing (profit), or a trade that is closed with a loss after position 20. Only one “Complete Operation” must be allowed at a time. Example: The EA is on the Grid in the 5th position and a new buy / sell condition is reached by the indicator. This trade should not be executed, since there is already an “Operation” in progress.

 

12) The file provided must be open source (mq5) so that I can make changes in the future and add more positions in the grid if necessary.

 

13) When “true” (will open a maximum of 2 positions of the Grid): the position will maintain the profit rules (item #4), but will close after reach “Range3_or_StopLoss” points. That is, instead of opening the 3rd position, it will close all positions.

 

*Average Price/Breakeven: The average price of all current Grid operations where the balance of the operation is $ 0. For example:

1 Lot at $50

2 Lots at $100

5 Lots at R$150

Median Price is (1x$50 + 2x100 + 5x150) / (1+2+5) = $125 .

If possible, I would like to see the line of “Median Price” on chart. Please tell me if this won’t be possible.


Respondido

1
Desenvolvedor 1
Classificação
(23)
Projetos
45
20%
Arbitragem
24
29% / 46%
Expirado
12
27%
Livre
2
Desenvolvedor 2
Classificação
(4)
Projetos
6
33%
Arbitragem
3
0% / 100%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(8)
Projetos
10
40%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
// @version= 5 strategy ( "EMA Crossover Strategy with 1:1.6 Risk-Reward" , overlay = true ) // Define the EMAs shortEma = ta.ema ( close , 10 ) longEma = ta.ema ( close , 20 ) // Plot the EMAs on the chart plot ( shortEma , color = color.blue , title = "10 EMA" ) plot ( longEma , color = color.red , title = "20 EMA" ) // Calculate the crossover conditions longCondition = ta.crossover ( shortEma , longEma )
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
Hello, I am looking for a highly skilled and experienced MT4 developer to assist with transferring a strategy currently coded in Pine Script to MetaTrader 4 (MT4). The project requires a professional who can handle this project successfully. I am looking for a dedicated and professional developer who can deliver high-quality results. If you have any questions or need further details about the project, feel free to
Hello, I am looking for a highly skilled and experienced MT5 developer to assist with modifying an existing MT5 file. I am looking for a dedicated and professional developer who can deliver high-quality results. If you have any questions or need further details about the project, feel free to reach out. Thank you for your time and consideration. I look forward to working with the right expert to bring this project to
We are looking for an experienced coder to develop a trading robot that utilizes two main indicators: 1) Brain Trend Signal 2) TMA (Triple Moving Average) Centered Bands. The robot should generate buy and sell signals based on specific conditions and include robust risk management features. Initial Requirements - **Indicators**: 1. Brain Trend Signal 2. TMA Centered Bands - **Timeframes**: - H4/D1 for trend
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend
hi this is a question regarding your telegram to metatrader copier. if i buy the premium/lifetime will it work on unlimited accounts? or will you lock in in an account
Hello, I'm looking for an MQL5 developer that can create an MQL5 code that can accurately mark the following: 1. Swing Break of Structure using Horizontal Ray 2. Internal Break of Structure using Horizontal Ray 3. Extreme Supply and Demand zones using Rectangle 4. Decisional Supply and Demand zones using Rectangle 5. Breaker Block zones using Rectangle 6. Buy to sell wick zones using Rectangle 7. Sell to buy wick
Make a 10000 plus script trading Expert advisor with detail and make it flawless with no errors no tiny mistakes and make it in mql 5 language. Make it adjustable for it to be able to trade on its own and not be disturbed and make it study the chart and be able to trade any currency pair. I have zero experience and I would just like to copy and paste the code in MetaTrader. Can you make it be compatible with both
I need a trading bot, My strategy works with the 1hour timeframe .My stop-loss should be put using Atr of the candle multiply by 1.5 then the value will be added or subtracted from my entry depending on if it's a buy or sell and my entry should be a candlestick pattern also in addition to when the 3 Ema corresponds .When the 8Ema is above the 20Ema and they are both above the 100Ema it is a buy and when the 20Ema is

Informações sobre o projeto

Orçamento
30 - 45 USD
Desenvolvedor
27 - 40.5 USD
Prazo
de 1 para 15 dias