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.
相似订单
Do you happen to have a profitable strategy for MNQ? it is urgent if any one can help me with this i will be happy to discuss with you and move forward to pay for it kindly let me know the amount thank fill free to bid
Looking for an experienced MQL5 developer to design and develop a custom Expert Advisor (EA) for MetaTrader 5. The purpose of this EA is not just automated trading, but also to help me better structure, test, and refine my personal trading strategy
I am looking for a developer to build a robust MetaTrader 5 Expert Advisor for Gold (XAUUSD) scalping on the M5 timeframe. The EA must be optimized for small accounts ($200 - $1,000). Technical Requirements: Primary Strategy: Mean Reversion using Bollinger Bands (20, 2.0) and RSI (14). Buy: Price closes below lower band + RSI < 30 + Trend Filter. Sell: Price closes above upper band + RSI > 70 + Trend Filter. Trend
Olá amigos possuo um indicador que não tem o código fonte mas tenho a licença para usar esse indicador que está me trazendo bons resultados no meu operacional desejo automatizar as suas entradas através de um robô funciona mais ou menos da seguinte forma o indicador gera um sinal de compra ou venda e também gera um nível de take profit stop loss.O robô deve fazer a leitura dos sinais e definir TP e SL nos mesmos
An additional indicator signal will be added to the existing EA. The existing mechanical system will NEVER be changed. I will send you the necessary documents and codes. I will send you the necessary documents and codes. thank you
Need MT5 Expert Advisor base on my strategy XAUUSD Fast scalping, Grid , Martingale, TP, SL trailing buy sell both also add magic number fully atumated advance strategy Pro version 24 hours running trades close in profit directly open new trade
Professional MT5 EA – XAUUSD I need a professional Expert Advisor for MT5 (MQL5) to trade XAUUSD only. This is not a random scalping bot. The EA must trade only high-probability liquidity breakouts during active sessions and avoid ranging or low-volatility markets. Symbol: XAUUSD Timeframe: M15 (optional H1 confirmation) Session filter (Dubai GMT+4): Trade only London and New York sessions Adjustable session times No
Hi Developers, I am looking for a EA based on EURUSD where EA is taking multiple trades in a day with small profits in each trade. Looking for some EA based on HFT trading, scalping
i need a trading bot that can make 100% profit in 1 day. with capital less than $200 i know this is risky but am willing to take the risk. ea has to be backtestable and also i will test for just 5 random days to make sure it works. and make a purchase if am satisfied with the 5days results. send back test results for me to consider and reply
Hello, good day to you Developers, I am looking for someone that can deliver on a project with the following requirements: The job I am about to give out will involve "Tradingview" and "Metatrader 5" Tradingview: for analysis, as the Strategy uses one second charts/candles, Metatrader 5: for executing and managing the trades. For this EA to work well for the project's aims, SPEED of execution is of upmost