Writing of an Expert Advisor based on EMA cross that utilizes a martingale

Specification

Objective: To Create an EA based on an EMA cross Strategy that utilizes martingale account management strategy with multiple profiles to better manage risk                     and  scale safely

Strategy Concept: This strategy was created around Volatility Index 75  on the 5 minute chart. It was Observed that this Index tends to  frequently form very          strong trends with short periods of consolidation. On applying a 10 period EMA offset at 0 And a 10 Period EMA offset at 500 , it was observed          that there tends to be on average at least a 1,000,0000 point movement in price in  a single direction after 1 or a few crosses  of EMA lines.          After applying a martingale strategy that increases lot size on every 'x' points in cumulative losses per martingale run, the risk of ruin          returned positive figures. The system uses a mix of dynamic and fixed stop loses, take profits and trailing stops to mitigate loses and          maximize profit. These levels are based on the EMAs as well.

Targeted pairs/index/Commodities: Volatility Index 75 , others(build to be able to be tested on currency pairs though doesn't have to be effective with)

Parameters: 

EMA1_period ;   EMA2_period ; EMA1_offshift  ; EMA2_offshift ;  EMA1_Method ;  EMA2_Method ;  EMA1_Apply2 ;  EMA2_Apply2 ; fixedTakeProfit ;    fixedStopLoss ; floatingTakeProfit ;   floatingStopLoss ;  floatingStopLoss_Type; 

(martingale)

no_of_Steps ; initial_step_size ; continue_after_final_step ; continue_type ; multiply_on_loss_amount ; multiply_on_loss_rate_factor;

Specification:

     1.After User enters parameter and initializes the bot, an alert should be issued informing user of the dollar amount that would be at risk per  martingale cycle. this can be  calculated as:

       amount at risk per run =  (Initial Step Size *multiply_on_loss_amount )[1+ ( Σ n * (multiply_on_loss_rate_factor))]   where ,  1 < n   < = (no_of_Steps

                   Formula in text was assuming  1 unit  = 100     points

     2. If EMA1 is Lower than EMA2 then Open a sell position 

else

If EMA1 is higher than EMA2 then Open a buy position

    3. If EA opened position but EMA lines cross line in other direction, close position and open other opposing position type( close buy and open sell).

     4.  On loosing a specified number of points ; ( >=  multiply_on_loss_amount ), The following position should open with

lot size  = initial step size * multiply_on_loss_rate_factor * number of current step    

     5. If the Accumulated  loss for current run is equal to or exceeds the previously calculated amount at risk per run then the EA must alert the user and  either   stop the EA, continue the martingale run  or restart the martingale run. (The purpose of the  continue_after_final_step ; continue_type ;  parameters)

     6. On opening a position the stop levels would be according to the  fixedTakeProfit ;   fixedStopLoss parameters. As price moves away from he entry   point if  the user selects a value equal to or above zero (=> 0) for the  floatingStopLoss  a trailing stop would be applied using either of 2 methods.  

If   floatingStopLoss_Type   = continuous ; then a regular trailing stop with the specified number of point will be applied to price

                        If   floatingStopLoss_Type   =  jump ; then for each specified number of units/points change in price (non-absolute) the stop loss jumps to             that many points bellow or above current price (jumping again only after price went up or down by the           specified amount of units once

     7. The floating TP is equal to the EMA2 Line if Line value is greater than  fixedTakeProfit  for a buy position and less than the fixedTakeProfit for a sell    position. If floating stop is enabled it would be based on the maximum value for The floating Tp(maximum relative to direction of trade)

     8. The EA would not consider other trades made manually or by other EAs. 

     9. The EA should update the user via comment :

the current step number ; the current martingale run number (since initiating) ; the accumulated loss on current run; the next lot size          run continuation type.

 


As an example, take point 1 , EMA1( the turquoise line  set at offset = 0)  crosses EMA2 which is offset at 500. If the initial step size is 0.01 then a   sell position is opened with SL set at fixedStopLoss . In this case even if the user was using a floating stop loss it would automatically default  to the fixed stop loss as the distance between the EMA 2 line and EMA1 line is below the permitted stop loss level.

At point 2 though the previously opened sell position has not reached the Fixed stop loss and the floating stop loss was unable to activate, the  position is closed and a buy position is opened. If the multiply_on_loss_amount is exceeded for the current step of the martingale run then the  opening lot size for the buy order 

initial step size multiply_on_loss_factor  *( current step number).  (Assuming we index steps in martingale run  starting at 1) . 

        Additionally for point 2  lets consider the yellow rectangle. If the stop levels for the buy position opened at point  2 is represented by the long sides  of the rectangle then price would've reached the stop loss before the moment , on close, that the EMA1 would below the EMA 2. The trade would  close at the price marked by the triangle however the sell position would open at point three where the EMAs cross after the close

For Point 4 , the previous sell position would be closed and a buy position simultaneously opened at the crossing of the EMA lines. The floating Stop  Loss ,if selected as a value  => 0,  would begin at the EMA2 line and dependent on the  floatingStopLoss_Type selected would either trail behind price  for each point movement, jump between prices as current price increases every  floatingStopLoss  units  or be equal to EMA2 so long as that value is  less than the  fixedStopLoss

    

Notes:

Use points not pips as unit of price measurement though that may be simplified by rebasing for user input. Formula in text was assuming  1 unit  = 100      points

  This would be the first version of the EA. I plan to use the same developer to apply more features in the future. features would include panels, buttons ,     a partials mechanism with multiple TPs, reporting to a website ect.

  I am aware the current method of calculating the next lot size becomes inefficient really quickly would like to discuss if other more efficient models           not posted here 

 Use this set as the initial starting parameters:

EMA1_period  = 10 ;   EMA2_period = 10  ; EMA1_offshift = 0  ; EMA2_offshift =  500;  EMA1_Method = exponential;  EMA2_Method = exponential ;    EMA1_Apply2 = close ;  EMA2_Apply2 = close ; fixedTakeProfit = 10,000 ;    fixedStopLoss = 5,000 ; floatingTakeProfit = no ;   floatingStopLoss = 0 ;     floatingStopLoss_Type = jump; 

(martingale)

no_of_Steps = 3 ; initial_step_size =0.005 ; continue_after_final_step = yes ; continue_type = restart ; multiply_on_loss_amount = 5,000 ;  multiply_on_loss_rate_factor = 1 ;


Responded

1
Developer 1
Rating
(8)
Projects
11
18%
Arbitration
6
50% / 17%
Overdue
1
9%
Working
2
Developer 2
Rating
(4)
Projects
6
0%
Arbitration
3
33% / 0%
Overdue
1
17%
Loaded
3
Developer 3
Rating
(40)
Projects
86
13%
Arbitration
30
30% / 47%
Overdue
35
41%
Loaded
4
Developer 4
Rating
(11)
Projects
11
0%
Arbitration
4
25% / 50%
Overdue
2
18%
Free
5
Developer 5
Rating
(787)
Projects
1355
72%
Arbitration
112
28% / 47%
Overdue
340
25%
Loaded
6
Developer 6
Rating
(137)
Projects
191
21%
Arbitration
12
58% / 25%
Overdue
1
1%
Loaded
7
Developer 7
Rating
(67)
Projects
74
7%
Arbitration
33
9% / 55%
Overdue
6
8%
Working
8
Developer 8
Rating
(134)
Projects
194
80%
Arbitration
17
29% / 47%
Overdue
10
5%
Working
9
Developer 9
Rating
(38)
Projects
42
31%
Arbitration
2
0% / 0%
Overdue
0
Working
10
Developer 10
Rating
(11)
Projects
12
42%
Arbitration
2
0% / 50%
Overdue
0
Loaded
11
Developer 11
Rating
(250)
Projects
400
38%
Arbitration
82
41% / 20%
Overdue
69
17%
Loaded
12
Developer 12
Rating
(261)
Projects
535
50%
Arbitration
54
41% / 37%
Overdue
224
42%
Working
13
Developer 13
Rating
(566)
Projects
639
41%
Arbitration
21
57% / 29%
Overdue
45
7%
Loaded
14
Developer 14
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
Hello developer, I just wanted to know if you have made a profitable Supply and Demand indicator Contact me let discuss and start fully immediately .i will be looking for great developer soon Best regards
Hi, I would like to have some functionality of an existing trade manager amended, and some new functionality added in order to suit my needs. The existing trade manager is free, so there are no licensing issues to worry about. However, I only have the .ex4 file, so you would need to decompile it first. I have attached the file here for you to see. This original manager was written for the exact strategy I trade by
Hello, I am in need of an expert to help me convert my tradingview pinescript to mt4, I will attach the file, But for now, I only got $15 for this project and the only payment method I can use right now is crypto, I will send it to you through crypto, Also I need someone that is ready to work because I still have lot of projects I will need him to do for me
THE GOAL OF THIS PROJECT IS TO DEVELOP AN EXPERT ADVISOR THAT OPERATES AUTOMATICALLY DURING MARKET OPENING SESSIONS,FOCUS EN FOREX ,CRYPTOCURRENCIES ,STOCKS, AND GOLD. BELOW ARE THE SPECIFIC REQUIREMENTS the EA should be able to analyze the 20 period and 200 period moving averages as part of its entry and exit estategy implementation of an order blockis required to allow the EA to open and close positions efficiently
EA for MT4 SUMMARY: The robot uses a Moving Average (MA) with 6 Levels (3 Levels above the MA and 3 Levels below the MA). It does not use other indicators. The robot will make transactions only when the price reaches these Levels, under certain conditions. No trades are made when the price reaches the MA. MA period and distance for Levels are adjustable! It is a semi-adjustable robot with many variables, which will
Liquidity sweep reversal EA based on Williams fractal with risk & trade management parameters build in should include following section in EA: entry parameters risk management trade management all based on given instructions
High I’m looking for someone to create a simple EA for MT4 that trades in 2 timeframes the 5 min and the 15 min chart with the trend and enters on pin bars with some conditions that I will specify if the job is taken but nothing complicated. Timeframe 5 min Chart and 15min chart simultaneously It looks to enter on the 5 min or in the 15 min chart it does not look for higher timeframe, they are the same condition for
I'm looking for someone who will take the source code of an existing trading bot and make some adjustments and tweaks to it. Mostly is about changing the UI and basic default parameters. No need to change the algorithm itself. The result must be a file that I can install as any other expert advisor in the MT4 terminal. For now I can share the more detailed task in my video
Hello I have purchased an EA from MQL market. The name of the EA is "Eternal Profit" and it works on MT4 only. Its available in market and you can still find it to run DEMO. Though I have purchased the EA but its not working properly for XAUUSD pair owing to some inherent programming issues in the EA. The same EA is working good on currency pair. The key issue is the decimal place in in the pair. Its designed for
I want to build a Trade Manager Panel Trade Manager Panel Requirements for MT4 1. Overview: The trade manager panel for MT4 is designed to provide me with efficient management of trades on individual charts/symbols. It consists of two main parts: Displaying information on currently running orders. Providing functionalities for setting and activating stop loss (SL), take profit (TP), and break-even (BE) levels

Project information

Budget
30 - 100 USD
For the developer
27 - 90 USD
Deadline
to 10 day(s)