GRID: Minimum spacing between buy orders up or down

MQL5 Experts

Trabalho concluído

Tempo de execução 6 minutos
Comentário do cliente
He tried his best and worked very very well!
Comentário do desenvolvedor
Thanks Alex... good luck !

Termos de Referência

Hallo,


MAXIMUM BUDGET $50. it needs to be completed within 5 hours of taking the job.


---->>>>>AT PRESENT:

  • My first order, opens to a certain set of criteria. the below is a filter for opening the rest of the grid trading.
  • Currently my EA places BUY orders spaced according to the set pips. ie. 20 pips. so everytime price moves 20 pips away from the last order, it will place another buy order. This is the code for it:  Last(0,"op")-step >= Ask
  • MaxOpenPositions > Positions() -> I limit the number of positions that are allowed to open
  • ClosedBar() +  CurrBar() - EA will not open a new position if one is already opened in the current bar
  • step>=minstepgrid*point() - The EA is not allowed to place orders if it is not equal or bigger than 20 pips ( when using geometric griding according to % and not pips)
  • (!EnableATRgridFilter || (atd7[1] < MAXATRforgrid*point()) - the EA will not place an order if the Average True Range is above a certain level.


---->>>>>PROMBLEM:

Summary: see attached screenshot: EA does not use lowest price to place next buy, it uses last buy orders price to place next buy.

See second screenshot, the pink question mark is where the EA must grid upwards. spaced 20 pips from on another. 

Firstly:

I have a button on my EA, that allows me to place an order manually with the same magic number. But if my manual order is higher than the last placed buy order, then the EA will use my last placed buy order which i placed manually - 20 pips to place the next buy order. It is therefore not using the lowest BUY order placed. Ie. say i grid every 10 pips. If first position opens at price $0 and the first grid step will be at $10 and the second grid step at $20. If Price moved to $10 and opened first grid and then retracted to $5 and I manually enter a buy there, the EA will open the next grid at $15 and not at $10 plus 10 pips.

Secondly: With this code: (!EnableATRgridFilter || (atd7[1] < MAXATRforgrid*point()) the ea will skip grids on the way down untill the ATR settels back to the correct levels. BUT, it will not place orders on the way up. I want it to grid upwards also.So say price is $0 and ATR is to big, and price moves to $20 and the ATR settles there- it will open a grid currently... But as price retracts to $10 i want it to place a buy order at $10. So that the spacing of orders will if price moves correctly be $0 $10 $20 $30. Also if price moves Say from $0 to $20 and ATR settles there, then the EA may open the grid at $20, say price then falls to $22 and i manually place a grid order at $22, price then retracts on its way bakc to $0, the ea can place an order at $10 cause.  as the rule below says the ea is not allowed to grid if orders are smaller than 20 pips from one another. so it will not use $22 minus 10 pips and  place one at $12. 


MOST IMPORTANT: THE EA is not allowed to place grids within 20PIPS (or whatever i set it too) within one another.



Here is the current code:

 if(EnableGRID && Last(0,"op")-step >= Ask && 0 < Positions(0) && MaxOpenPositions > Positions() && ClosedBar() && CurrBar() && step>=minstepgrid*point() && (!EnableATRgridFilter || (atd7[1] < MAXATRforgrid*point()) ) )

       {         

        double lot=Lot(0);

        

        MarketOrder(Symbol(), POSITION_TYPE_BUY, lot, 0, 0, 0, Magic, Slippage*PipValue);      

       }    

Arquivos anexados:

PNG
GRDI_UP.png
29.1 Kb

Respondido

1
Desenvolvedor 1
Classificação
(183)
Projetos
235
59%
Arbitragem
7
29% / 29%
Expirado
8
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(8)
Projetos
18
17%
Arbitragem
3
67% / 0%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(298)
Projetos
427
26%
Arbitragem
18
61% / 33%
Expirado
26
6%
Livre
4
Desenvolvedor 4
Classificação
(52)
Projetos
97
24%
Arbitragem
10
20% / 20%
Expirado
12
12%
Trabalhando
5
Desenvolvedor 5
Classificação
(568)
Projetos
641
41%
Arbitragem
21
57% / 29%
Expirado
47
7%
Trabalhando
6
Desenvolvedor 6
Classificação
(68)
Projetos
77
8%
Arbitragem
33
9% / 55%
Expirado
6
8%
Trabalhando
Pedidos semelhantes
1) the EA can compound the lot size from 0.01 to 0.02 so on 2) the EA must able to trade different kind of pair 3) the EA will have stoploss or take profit 4) long term profit 5) for equiry will be 100 for every 0.01 lot Developer will have that kind of EA may apply and introduce any investor account! this EA must have mql4 file
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Helvetica Neue'} Hello Looking for someone to help me improve my current strategy on my own algorithm and to also add hedging mode
I want the script in mql5 language for my martingale strategy. The script should open trades in both directions buy and sell and if any trade closes in loss then open new trade in that direction by using the next volume and when trade closes in profit then reset the volume to first from volume list and also maximum consecutive losses limit will apply. If trades closes consecutively in losses and hits the limit then
Long Position 1. Trend Line: When a Lower High (LH) is formed, draw a trend line from the previous Higher High (HH) to the new LH. 2. Trend Line Adjustment: If a new Lower High (LH) is formed without breaking the trend line, redraw the trend line to the new LH. Draw a trend line between the Higher High (HH) and the Higher Low (HL). If a new Higher High (HH) is formed, remove the previous trend line and draw a new one
Please watch the video on this youtube channel and download the Indicator from there. https://www.youtube.com/watch?v=ldTomLu8DxE&amp ;t=32s Rules are explained on the video and the download of the indicator is on the same video
I would like an EA that follows exactly this steps to trade de daily candle. Watch the video and then see if you can do the task. https://www.youtube.com/watch?v=g3oDYq4P9ZE Document is one this link https://cdn.discordapp.com/attachments/1135977927469703230/1135978751461695598/Daily_Bias-TTrades_edu.pdf?ex=669a9a27&amp ;is=669948a7&hm=96de195f7e695a381c1261b065f67b94fae319d02a0c88641b146f8b2978320c& Should have
I have a custom EA that works fine in the live market trading, but when doing a back test in the strategy tester , it does not open sell orders. There are no errors or warnings; it just doesn't open sell orders. I've checked every possible reason that might be the reason why it does not open sell orders, but I can't find anything, especially since it works fine in the real market and it opens both buys and sells
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I'm looking for someone to help me create an arbitrage trading robot that can trade on any decentralized exchange. I had one created in python, but I would like it to work in MT5 with various regular rules that make it profitable
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated

Informações sobre o projeto

Orçamento
50+ USD
Desenvolvedor
45 USD
Prazo
para 1 dias