Moving average based EA for MT4 using a modified trailing stop

MQL4 Experts

Specification

Moving average Ea

·         This ea will use 2 timeframes, 5 ema’s, a Hull moving average, and atr for placing stop losses

·         For now let’s name the 5 ema’s.  Blue=10,  Green= 15,  yellow=30, red =60 ,  purple= 90 (the values should be changeable)

·         We enter a long when on the higher time frame the blue crosses above the green.  We enter on the 5 minute chart immediately at the crossover, we don’t wait for the close of the candle.  We are now locked into only long trades for the rest of the higher timeframe candle.  To clarify, the moment the blue crosses above the green on the higher timeframe we immediately enter a long and can only be long until at least that candle on the higher timeframe closes, even if the blue green oscillates a few times on that candle. If the blue is back below the green ema at the close of the highest timeframe candle we are back in short only conditions.  See Video for clarification. https://youtu.be/Nq9yfNv2FP8 

For long trades we enter on the following conditions

·         Immediately when there is a blue/green ema cross on the higher timeframe. 

           The green ema is below the yellow ema and then the blue ema crosses and closes above the green ema. 

·         When the green is above the yellow and yellow above the red and the following happen  (see video  https://youtu.be/5t4PaJf3HBY)

§   1.  The body of a  candle crosses and closes above any of the purple, red or yellow ema’s

§  2.  When the body of a  candle crosses  and closes above the green ema but only if the HMA is more than “X” pips above the 15 ema

§  3. The close of any green candle when the blue and green ema’s are above the hma

§  4.  When the body of a candle crosses and closes above the hma

 

Other entries

   . Purple extreme entries with toggles for red as well  (https://youtu.be/cmI9uVLQ8Io)

 .  Extreme reverse stacked entries crossing hma  (https://youtu.be/uCJJH4Nqrvs)

o   Short trades will be exactly the same but opposite conditions with the ema’s and only when the blue crosses below the green on a higher timeframe. 

o   For all entries we will normally enter at the close of a candle, but I would like an option to enter on a live candle for any of the previously mentioned entry criteria if the candle is more than “X” pips.  So for example the live candle pip criteria is set at 10 pips and a candle increases 8 pips and then crosses the 50 ema and goes up 2 more pips we enter live because the candle has increased by 10 pips.   (https://youtu.be/VI3vD7KB0tU)

Stop loss:  Set stop loss using atr multiplier.  I’d like an option to do the atr multiplier plus the spread at the entry of the candle as well.  Please allow a toggle to add the spread for short and a separate one to add the spread to longs.

How to exit trades.-   I’d like to be able to toggle between three different ways to exit trades                                                                     

                                                1.  Exit a long when the higher time frame blue crosses and closes below green

                                                2.  Exit a long when the current time frame blue crosses and closes below green

                                                3.  based on a series of trailing stops.  Let’s base the profit in terms of multiples of the stop loss in pips.  So if the current stop loss is 10 pips and we reach 10 pips profit we are at 1x profit.  If we reach 20 pips we are 2x profit.  So for the trailing stops we set a profit we much reach for the trail to kick in.  Example.  Reach 1x profit set trailing stop to 0.8x profit.  So if profit reaches 1x profit and turns against Exit me trade closes at 0.2x profit.  At the same setting if the price were to go to 1.4x profit and then turn .8x trail would now close it at 0.6x profit.  Then the second profit level we need to reach at 2.5x profit will have a ts of 1.5x profit.  So any profit gained above 2.5x can only fall by 1.5x profit before closing.  (https://youtu.be/VLCSRjoi2to)

  Please set it up like this

-Profit #1 need

Profit #1 Trailing stop

 

Profit #2 needed

Profit #2 Trailing stop ….. do this for 10 trailing stops.

 

·         Please also create a max spread parameter to prevent the entry of trades when the spreads are really high and a minimum stop loss to prevent really small stop losses.

·         Create lot size based on percent of account. 

·         There should only be one current trade at one time, a new long entry can’t close an existing long.  But a new short entry should automatically close an existing long and vice versa.

 

Please have the following parameters in the ea

1.       Max spread to allow entries

2.       Minimum stop loss

3.       Higher timeframe being used

4.       Current timeframe being traded

5.       Fast Moving average higher timeframe

6.       Slow Moving average higher timeframe

7.       Current timeframe MA #1-Blue

8.       Current timeframe MA #2- Green

9.       Current timeframe MA #3- Yellow

10.   Current timeframe MA #4- Red

11.   Current timeframe MA #5- Purple

12.   ATR Period

13.   ATR Multiplier

14.   Enable add spread for longs

15.   Enable add spread for shorts

16.   Candle size needed for live entries

17.   Hull Moving Average

18.   Distance Hull MA needs to be above/below Green ema

19.   Exit- Toggle on off for blue crossing green on higher timeframe

20.   Exit- Toggle  on off for blue crossing green current timeframe

21.   Exit- 10 Trailing stops

22.   Lot size as percent of risk

 23.  Enable LIve entry

24.  Purple extreme toggle with yellow over red over purple

25 Purple extreme toggle with just red over purple

26.  Extreme HMA cross toggle on/off

(there may be more variables needed as you see fit.)

I also recommend building the ea with one entry at a time and testing as things can get pretty complicated quickly.  I also recommend building the exit conditions early on because I know that the trailing stop criteria is unique and others have struggle to build it correctly




Responded

1
Developer 1
Rating
(27)
Projects
27
26%
Arbitration
0
Overdue
0
Free
2
Developer 2
Rating
(55)
Projects
80
54%
Arbitration
9
33% / 33%
Overdue
7
9%
Working
3
Developer 3
Rating
(56)
Projects
167
69%
Arbitration
4
100% / 0%
Overdue
1
1%
Free
4
Developer 4
Rating
(375)
Projects
473
40%
Arbitration
82
37% / 33%
Overdue
13
3%
Loaded
5
Developer 5
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
I'm looking for an experienced developer to convert a TradingView indicator script into an MT4 (MetaTrader 4) compatible format. The script, written in Pine Script version 5, includes custom indicators and graphical elements such as lines, boxes, and labels that we need to be accurately replicated in MT4
I already have a Fibonacci based indicator which give precise entry as well as take profit and stop loss levels without repainting. I want to convert this to an EA so as to enable it pick trades automatically. Pay attention to the attached Images for entry and exit description. The EA will be protected with password or any other security protocols. THE EA OUTPUT will be in MQ4 & MQ5
I need help with a specific issue in NinjaTrader 8. I'm using Strategy Builder to automate my setup, but it's ignoring some of my conditions for shorts, and not placing long trades at all. I've set up many other Strategies, and never had issues like this, so I suspect the cause is the indicator I'm using, which is the Ichimoku Cloud from the NT User App Share. So what I need is a new version of the indicator that
// Define the properties input int ShortPeriod = 12; input int LongPeriod = 26; input double LotSize = 0.1; // OnTick function is called every time there is a price update void OnTick() { double shortMA = iMA(NULL, 0, ShortPeriod, 0, MODE_SMA, PRICE_CLOSE, 0); double longMA = iMA(NULL, 0, LongPeriod, 0, MODE_SMA, PRICE_CLOSE, 0); double prevShortMA = iMA(NULL, 0, ShortPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
Necesito un bot decente para prueba de fondeo y también cuenta personal, scalp, no grid, no martingale, no practicas prohibidas, algo objetivo, confiable y rentable... 5 Min mínimos de duración por operación, algo ya hecho y bactesteado en cuenta real y de fondeo. Necesito algo agresivo, constante pero que no exponga el capital... prefiero una estrategia de smc
Modify existing EA 50 - 70 USD
Hi, The task involves adding functions to an existing EA and correcting an error. The developer must have a thorough understanding of the following: Trailing Take Profit function Calculating a decreasing distance between orders Ability to code a function for Global Profit decrement/increment size in percentage Ability to correct error 10015 Thank you in advance
Looking for experienced programmer to create a trend line breakout and trend line bounce indicator that send alert with arrow on screen without open trades multiple currency pairs time frame M15 H1 H4 D1 W1 MN
Hello programmers, I need a coding assistance to do the following job. Currently the EA opens two different trades one has a comment "Originial" and another has comment "Series" The job is if the Original trade is negative by x pips, open a hedge trade(Hedge1#-OrderTicket of the soruce trade) along with one buystop and a sell stop order and the comment of the trade will be "Recovery#1-+OrderTicket() of the original
Profit EA 50+ USD
//+------------------------------------------------------------------+ //| SimpleEA.mq4 | //| Generated by MetaEditor | //| https://www.mql5.com/en/docs&nbsp ; | //+------------------------------------------------------------------+ #property strict // Input parameters input double LotSize = 0.1; // Lot size input int MovingAveragePeriod = 50; // MA
I have a EA and A Indicator I want to upgrade with some new features I want to add to the Indicator And The EA Also there is a memory error in the system that is showing up in the journal after the ea is ran on multiple charts I will need to get this fixed as well Indicator is 528 lines of code EA is 703 lines of code Dashboard I want to add is 1974 lines of code Indicator Changes I want to change the indicator The

Project information

Budget
100+ USD
For the developer
90 USD
Deadline
to 10 day(s)