Modification to persistent levels EA to make it more efficient and less management intensive

MQL4 专家

指定

The goal here is to get trades opened at or near support and resistance levels and allow the user to manually trail until the market takes out the trade. Use of take profit will be rare and only in sideways markets. I have something similar but this has enough changes in the logic to justify building a whole new EA with code the programmer is familiar with. All we would be able to keep is the Magic number and some of the trigger coding which is not so difficult to put together again.

 User can draw horizontal lines on MT4 chart with EA and EA will incorporate those lines as trade levels. Additionally i would like to add an offset variable so that the trades do not happen on each line but a user defined distance from each line. There still needs to be a trigger distance to determine the market is moving in the desired direction with enough momentum to justify the trade. Essentially this is grid strategy but the levels reactivate them selves based on user drawn lines.


Proposed Logic:
M = Magic #
SL=Stop loss
BE=Break even trigger
BEP=Break even (pips)
IS=initial stop loss
ED=trigger distance
ER=Extra risk management
P@=price at tick (current price)
BP=buy price
SP=sell price
HLA=Horizontal line above current price
HLB=Horizontal line below current price
IT=Incremental trail
OS:Offset

New trade logic
if HLA-ED-OS>P@ then buy at HLA=yes 
Buy at HLA=yes/no (once this changes to yes it will stay yes until the level is triggered or the EA is removed from the chart)
if HLB+ED+OS<P@ then sell at HLB-=yes
Sell at HLB=yes/no (once this changes to yes it will stay yes until the level is triggered or the EA is removed from the chart)
if ER=no then ER=0 always
if ER=yes then check for open trades when level is reached Only place a new trade if all buy stop losses > buy price AND all sell stop losses < sell price result =ER
if ER>0 no trades can be placed

if P@=HLA +OS (+/- Slippage) AND buy at HLA=yes AND ER=0 place buy trade

if P@=HLB -OS (+/- Slippage) AND sell at HLB=yes AND ER=0 place sell trade

Open trade management logic
if P@>BP+BE AND SL<BP+IS move stop loss to BEP
if P@<SP-BE AND SL>BP-IS move stop loss to BEP
if IT=yes any time a stop loss is moved all trades with same M will have the same stop loss.

Trade Preperation Logic:
Lot size = equity*risk%/initial hedge
stop loss = entry price +/- initial stop loss
take profit = Take prfit if >0


user set variables:

MAGIC NUMBER: so that the same EA can be run on multiple pairs

RISK %: The lot size should be calculated using Equity *(risk%*.01)/initial hedge. In the example if its a $2500.00 account with no open trades it would be 2500*.02= 50/25=2*0.1= 0.2 lot size. This will allow the value to change at the time of trade according to current equity. It will be important when trading multiple pairs.

EXTRA RISK MANAGEMENT (Yes/No):If no this sequence is skipped. If yes Before a new trade is placed it needs to check all open trades regardless of magic number and verify that buy trades have stop losses > entry and sell trades have stop losses < entry. Only 1 open trade should ever be at risk. if there is already an open trade that has not moved to break even or better then no new trade should be placed. This functions independant of Incrimental trail as all trades move to break even when trigger is reached.

TRIGGER DISTANCE: distance from line where the trade becomes active. While i do not want to use pending orders i do want the EA to act as though they are pending orders set when the level is further away than the LEVEL TRIGGER DISTANCE. For examle if there is a resistance level at 1.11250 and the trigger distance is set to 25 pips then if the market is already at 1.11010 and moving up the trade will never take place but if the market falls below 1.11000 then moves back up the level will be active and a trade will be taken at 1.11250. If it were a pending trade the trade would be created any time the market falls below 1.11000. 

BREAK EVEN TRIGGER (pips): a # in pips at which point the stop loss will be moved to break even. This needs to be persistant so if the user accidently moves a break even to a losing position it will move back. however the logic sould dictate that it will not move any stop loss moved to a more proffitable position than the initial break even.

SLIPPAGE (pips): # in pips in case the market is really moving at the time the trade is taken.

BREAK EVEN (pips): a # in pips to define what break even is.

INITAL STOP LOSS (pips): a # in pips to determine how far from the trade the initial stop loss is placed

OFFSET: a # in pips away from the level at which a trade would be taken. This makes space for peak overs. example if this is set to 10 and there is a level at 1.25000 then the buy would be activated at or below 1.24750 and the buy would be entered at 1.25100. All other variables are based on actual entry level of the trade so they would enter based on the 1.25100 price for a buy.

TAKE PROFIT (optional): there may be times when i want to set a take profit for each trade this is where it would be done. 0= let it run without take profit. but it could be set at any # in pips.

INCREMENTAL TRAIL (Yes/NO): This is a yes or no option. If it is yes then any stop loss that is moved by the EA will move stops for all open trades with the same MAGIC NUMBER to the newest position.



Detailed example : Using real data from gbpjpy 4 hours candles assuming 25 pips for all triggers as well as initial stop loss and 3 pips for break even.4-5-18 to 4-18-18 levels at 150.389, 152.001, 153.460. Market opens at 150.350 this is near a line but too close so no HL+=no there is not trade at 150.350 the line may as well not exist.The market moved down over the next 4 hours to 28 pips, when it crosses 25 below the level them HL+=YES  a buy trade at 150.350 will be taken the next time the price touches it. 8 hours later it crosses that level and a BUY market order is placed with a stop loss set 25 pips down.  At this point as HL+ = 152.001 and YES and 150.350 is HL-=NO.During the next 4 hours the market draws down but not to 25 pips so the trade is still active. About 6 hours after the trade is taken the trade reaches 25 pips profitable and the stop loss is moved to 3 pips (break even) and HL-=yes@ 150.389. Over the next 2 days the market continually moves up and down but not quite low enough to stop out the trade. The user may have caused a stop out by manually trailing but for this example assume the trade is still active on 4-10-18 when between midnight at 3am the market crosses the 152.001 level which has been HL+=yes since the prevous trade stop loss was moved to 3 pips profitable and so a new buy trade is triggered. This buy trade triggers and since Incremental Trail is on both trades set their stop losses at 151.751 and during the next 4 hours both trades stop out one losing 25 pips and the other in profit 135 pips. 8 hours later the market has moved down 30 pips causing HL+=YES again at the same level and then moved back up triggering another buy. This time it goes up just enough to move to break even as well as activating the same level as a sell and then it goes back down and closes the buy trade and triggering the sell. on 4-12-18 the market goes back up closing the sell trade at break even assuming again that the user did not manually trail to get some profit out of the downard move. The buy is triggered again. This time over 24 hours it moves up to trigger the next level crossing it and then coming back down after going 40 pips past the entry and triggering the move to break even moving both stop losses first to the 25 pips below and then to 3 pips in profit for the most recent trade. The market then comes back 4 hours later and stops out both trades. This also triggers the sell trade that was activated when the buy trade moved 25 pips profitable. The market then moves down 70 pips activating the sell and moving the stop to break even. This is where the example ends but i'm sure you get the picture.


反馈

1
开发者 1
等级
(33)
项目
35
40%
仲裁
11
9% / 91%
逾期
4
11%
空闲
3
开发者 3
等级
(251)
项目
400
54%
仲裁
9
67% / 22%
逾期
36
9%
空闲
4
开发者 4
等级
(84)
项目
149
31%
仲裁
32
34% / 41%
逾期
43
29%
空闲
5
开发者 5
等级
(66)
项目
95
28%
仲裁
20
25% / 55%
逾期
24
25%
空闲
6
开发者 6
等级
(16)
项目
21
19%
仲裁
7
0% / 71%
逾期
14
67%
空闲
7
开发者 7
等级
(43)
项目
72
49%
仲裁
4
0% / 50%
逾期
19
26%
空闲
相似订单
Here is the Idea: I want a Semi Auto Trade Panel Manager EA that only activates when I press the BUY or SELL or BUY LIMIT or SELL LIMIT then the EA will do the rest : that includes the BUY STOP 0r SELL STOP and the hedging calculations according to below diagram. So overall , my only intervention is entering the lot size , hedge zone distance and TP ratio or entering the price for buy limit/sell limit then pressing
Hi, I'm looking for a martingale MT4 EA that performs a lot of trading volume per day. If you have the robot, you'll need to send me the demo so I can backtest it. Thank you very much
Hello potential Freelancers I’m very new to trading so please bear with me as I try to explain what ‘m looking for. I'm currently getting signals ( XAUUSD )sent to me and I’m looking to find a person who can look at the data either watch account live, or I send the trade history. The bot my provider is using makes 100’s of trades a day and does very well on average. I’m also looking to have the following features
Hi guys I would like to k ow if someone has experience with machine learning models? I would like to train a model to identify if there is a range market or trendy market based on several parameters like EMA and ATR for example. If we use for example a 20 and 50 EMA and we measure the distance between both lines the algo should oearn if the trend is strong or weak. If it‘s steong it keeps trending and if it‘s weak
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA
we want to build a dashboard ea that would display on another chart key metrics : i will foward screeshot of what i want to dashboard to look like : the function i would need to get display are the following: 1. classified past performance ea by magic number ( with classic : total trade , total profit , return/dd , max dd (base on history) , ) 2. equity chart of performance if we click on a magic number we should
the task will be actually quiet simple , i need an active develloper to devellope out of 3 updates an ea STEP 1 (this job): make a classical pair trading ea , that can calculate correlation between assets and trade when the correlation diverge above a specified % the develloper that will postulate for the job will need : 1- to be ok to do the full project this job and the update following 2- very low arbitration , i
Hello, I want to create an EA that can be able to take and optimise trade bids using the trend tracker concept I have developed. The tracker will monitor the 2 lines in the below pictures and then start to activate bids once they cross each other and then be able to manage all bids afterwards towards the direction of the market by opening and closing them intermittently and profitably until the position at the other
Hi man, How are u? I have an EA and I need to check few aspects of the code, if It works fine? I am looking for an expert coder, who can understand mt4 language and help us to solve this out. This job will hardly take about 3-4 hours max for an experienced coder, when explained detail. Also, I would like to give this to someone, who can understand and speak English well. Also, the coder should be able to come via
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA. THREE TYPES OF ENTRIES 1: AGGRESSIVE 2: DIVERGENCE 3

项目信息

预算
50+ USD
开发人员
45 USD