GRID: Minimum spacing between buy orders up or down

MQL5 Experts

Tâche terminée

Temps d'exécution 6 minutes
Commentaires du client
He tried his best and worked very very well!
Commentaires de l'employé
Thanks Alex... good luck !

Spécifications

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);      

       }    

Répondu

1
Développeur 1
Évaluation
(279)
Projets
378
72%
Arbitrage
19
32% / 47%
En retard
16
4%
Gratuit
Publié : 15 codes
2
Développeur 2
Évaluation
(9)
Projets
19
16%
Arbitrage
3
67% / 0%
En retard
0
Gratuit
3
Développeur 3
Évaluation
(298)
Projets
427
26%
Arbitrage
18
61% / 33%
En retard
26
6%
Gratuit
Publié : 8 codes
4
Développeur 4
Évaluation
(54)
Projets
102
23%
Arbitrage
12
25% / 17%
En retard
13
13%
Gratuit
5
Développeur 5
Évaluation
(568)
Projets
641
41%
Arbitrage
25
48% / 36%
En retard
46
7%
Travail
6
Développeur 6
Évaluation
(72)
Projets
80
10%
Arbitrage
38
8% / 58%
En retard
6
8%
Gratuit
Commandes similaires
I need a fully automated custom Expert Advisor for MetaTrader 5 (MQL5). The EA is intended for use on a The5ers $100,000 2-Step prop-firm account. IMPORTANT DELIVERY REQUIREMENT: I must receive the complete editable .mq5 source code as well as the compiled .ex5 file. Compiled-only delivery is NOT acceptable. The EA must be coded specifically for this project and must not copy trades, use external trading signals or
I've got a Pine Script from Trading View. I need help from a programmer who can help with optimising the strategy by 1) Adding a couple of further rules 2) Redesign the trading alert arrows & colours I need, please, a programmer who is 1) Good at Pine language 2) Has excellent after-job support (not for free though) 3) Possess the ability to work with others. 4) Able to deliver the job at the shortest possible time
I need an experienced TradingView Pine Script developer to build and test a custom intraday strategy for NQ/MNQ . I am not looking for a conversion . I need the strategy researched, developed, tested, and optimized based on my requirements. Requirements: NQ/MNQ intraday trading 5–15 minute charts New York session only Flat before market close Base logic using Zero Lag Signals , with additional filters if justified
Le robot devra : Respecter strictement les règles de risque des comptes FTMO : perte journalière maximale, perte maximale totale, taille des positions, etc. Intégrer un système de gestion du risque automatique. Être capable de gérer différents types de comptes et tailles de capital. Être basé sur ma stratégie et mes règles de trading que je fournirai au développeur. Être entièrement automatisé pour l’exécution des
I am looking for an experienced MQL5 developer to build a professional MT5 Expert Advisor specifically for XAUUSD (Gold) and other indices. I saw that XAUUSD is one of your primary areas of specialization, so I would like to discuss a custom EA with you. My priority is NOT extremely high returns. I want a robust EA designed for controlled risk and long-term survival. Requirements: • MT5 / MQL5 • XAUUSD, usoil,btc and
VENOM EA 35 - 50 USD
So, im a beginner and I'm pleading you to built me a bot that runs 24hrs and that can buy and sell at the same time, choose a better and profitable strategy. I will do anything thing it takes to get the bot. I hope you take my request into consideration
Je cherche un développeur MQL4 / MQL5 expérimenté pour créer un robot de trading automatique (Expert Advisor) performant et sécurisé. Validation de comptes Prop Firm capable de trader sur le forex et les matière première
XAUUSD Digger 50 - 300 USD
I want you to create a strategy that fits for my funded account conditions like winrate of 60%+ with good risk reward ratio min 1:2 and max drawdown per day is 2% or 3% and overall should be less then 10% with less consecutive losses should be able to finish the funded stage in of phase 1 8% target and phase 2 of 10% target in a month with good number of trades in a month need journal of all the back tested data and
I need a simple Expert Advisor for MT5 that trades based on RSI overbought/oversold levels. - Entry: Buy when RSI(14) < 30, Sell when RSI(14) > 70 - Exit: Take Profit and Stop Loss as adjustable input parameters (default 50/25 pips) - Position sizing: Risk 1% of account balance per trade, auto-calculated from stop-loss distance - Timeframe and currency pair: adjustable inputs, not hardcoded - Should include basic
1. Trading Instruments: - The robot should trade exclusively on the following currency pairs: - NZD/CHF - NZD/USD - GBP/USD 2. Trading Style: - The robot should implement a day trading strategy, focusing on short-term trades. 3. Risk Management: - Maximum drawdown percentage: 10%. - Stop loss settings: Adjustable based on volatility (suggested default: 30 pips). - Take profit settings: Adjustable

Informations sur le projet

Budget
50+ USD
Délais
à 1 jour(s)