Need order management EA based on specified levels

MQL5 Esperti Futures

Lavoro terminato

Tempo di esecuzione 11 giorni
Feedback del cliente
good communication

Specifiche

Will need source code for EA. 


Variables user input: 

Marketopentime 

Sessionstarttime 

Balance 

Tickspec ($) 

Risk%  or fixed contracts (allow users to pick one)

Tradecycles=set max cycle of trades. (calculate how many cycle of trades have been taken. Only count when trade hits TP) 

Calculate levels to draw: 

Determine the range from highest High to the lowest Low between Marketopentime to Sessionstarttime 

Draw out 25% levels between the High and Low. Should be 3 levels between High/Low (25%, 50%, 75%) and 5 levels out from High/Low (125%,150%,175%,200%, 225% and –25%, -50%, -75%,-100%,-125%) 

10%range=Calculate the 10% of the range in ticks (High-Low)*4 –use standard rounding 

These levels are FIXED until trade has hit TP in profit 

Size = risk% x balance (in $) 

$pertick =size / 10%range (in $) 

Contracts = $pertick/tickspec (round up to nearest integer) 

TRADE #1 

Place limit orders using contracts at calculated High and Low (buy limit at low, sell limit at high)* 

Target1=high-1 level or low+1 level 

*Cancel other limit order when one is hit  

Stop and reverse order at high+2 levels or low-2levels (double contracts since this is stop and reverse) 

Calculate new levels right after trade #1 hit tp 

TRADE #2 (if trade #1 stopped out) 

Calculate loss from previous trade in ticks  

Loss1 = calculate the loss PnL from previous trade in $ 

Target2=loss1/(contracts*tick spec)+10%range (basically loss in ticks+10%range) 

Place limit orders at drawn levels from before 

Add limit orders with contracts at previous drawn levels and update new target2 until target is hit. With additional contracts, the target gets smaller per the Target2 calculation above. 

Reset timer to next hour after TP for trade #2 is hit 


Example 1 

Red line = sessionstarttime 

Balance=$5000 

Tickspec=$1.25 

Risk%=0.5% or 0.005 

Calculated High=4297.25 

Calculated Low=4284.75 

Draw out 25% levels  

Calculate the 10%range from High/Low 

Calculated contracts =4 

 

  1

Draw out the levels  (basically at 25%, 50%, 75% between high and low) then every 25% above high and below low (5 levels both sides). Total 13 levels 

2


Limit order 4 contracts at high and low and target is at 25% (high-25% or low+25%). Cancel the other order when one is triggered (in this case long was cancelled) 

  3

  

Update levels right after TP


EXAMPLE 2 

Balance=$5000 

Tickspec=$1.25 

Risk%=0.5% or 0.005 

Calculated High=4300.75 

Calculated Low=4284.75 

Draw out 25% levels  

Calculate the 10%range from High/Low 

Calculated contracts =4 

 

  4 

Draw out levels (25%, 50%, 75%) and 5 levels above high and below low 

5

 

Limit order 4 contracts at 4284.75. Target 4288.75, stopandreverse 4276.75 for long, and 4309 for short. 

Long triggered (cancel short limit) 

Actual loss was 4284.75-4276.5 (slip in this case) = 33 

10%range = 6 

Totaltarget on trade#2 = 39 ticks or 4266.75 


6

Reset timer to next hour: example if TP is hit at 1:57, reset at 2 to draw out new levels and restart the cycle. If TP is hit at 2:07, reset at 3. If TP is hit on the hour, reset next hour as well

 

EXAMPLE 3 

 

Balance=$5000 

Tickspec=$1.25 

Risk%=0.5% or 0.005 

Calculated High=4465.00 

Calculated Low=4432.75 

Draw out 25% levels  

Calculate the 10%range from High/Low 

Calculated contracts =2 

 

7

 

Draw out levels (25%, 50%, 75%) and 5 levels above high and below low 


8


Limit order short 2 contracts at 4465 TP 4457 stopreverse 4481.25, Limit order long 2 contracts at 4432.75 TP 4441. 

 Short triggered (cancel long limit).  

Stop and reverse at 4481.25 (double contracts to reverse position) 

Loss ticks = (exit price (actual entry of reverse price) - entry price) x 4 = 65 ticks 

PnL loss = lossticks*previous contract*1.25 = $162.5 

Calculated 10%range=13 ticks 

But added positions at 4473.25, 4465, 4457 = 8 contracts total 

Calculate TP for 2nd trade= 

162.5 / (8*1.25) = 16.25 = 17 ticks (roundup to nearest integer) 

Average price with 8 contracts = 4469.25 

Target with 8 contracts = 4486.25 

 

9 

Reset timer to next hour: example if TP is hit at 1:57, reset at 2 to draw out new levels and restart the cycle. If TP is hit at 2:07, reset at 3. 


Con risposta

1
Sviluppatore 1
Valutazioni
(34)
Progetti
60
23%
Arbitraggio
11
73% / 9%
In ritardo
3
5%
Gratuito
2
Sviluppatore 2
Valutazioni
(119)
Progetti
169
38%
Arbitraggio
9
78% / 22%
In ritardo
15
9%
Gratuito
3
Sviluppatore 3
Valutazioni
(233)
Progetti
414
34%
Arbitraggio
52
37% / 40%
In ritardo
153
37%
Caricato
4
Sviluppatore 4
Valutazioni
(472)
Progetti
501
52%
Arbitraggio
10
60% / 20%
In ritardo
3
1%
Gratuito
5
Sviluppatore 5
Valutazioni
(45)
Progetti
59
44%
Arbitraggio
8
50% / 38%
In ritardo
7
12%
Gratuito
6
Sviluppatore 6
Valutazioni
(194)
Progetti
198
27%
Arbitraggio
0
In ritardo
3
2%
Gratuito
7
Sviluppatore 7
Valutazioni
(16)
Progetti
29
48%
Arbitraggio
0
In ritardo
6
21%
Gratuito
Ordini simili
hey friends, I am looking to build a smart trading robot, for the capital market. He knew how to trade in all the different types of trade. Example - in shares, currencies, index, indices, ETFs, funds, commodities, options, futures and so on. Suitable for trading on all stock exchanges in the world. It will be possible to install the trading robot in the MetaTrader 5 trading software. But it will also be possible to
Hello Greetings. I have a custom tradingview strategy I would like to convert to Metatrader 5 ( mt5 ) . I have the source code a and with me. Kindly bid if it is what you can do for me and let discuss about the project. Thanks
Hello there, I need a mql4 EA based on pine script custom indicator. You need to do pine script indicator convert into mt4 advisor. If you are able to do please contact. Thanks
Can you get my drafts to work? Have to conditions in RSI and Stoch oscillators ,,,I have a draft but its not run,, you can help me? if iRsi <30 ordersend op_sell iStoch > 80 ordersend op_sell Period_15M Send Orders_Buy limit Pivot Price Send Orders_Sell Limit Pivot Price
I need a AI signal generating bot for forex trading. The bot should operate such that when i put it in a chart it will analyse the market, after several minutes it will display whether the trade is buying or selling. It should display the one minute, five minute,15minute, 30 minute, one hour, 4 hours and daily time frame whether they are buying or selling. If it is buying the arrow should be green and if it is
Using Bollinger Band only. When price closes above upper BB, open Buy. If the length of the candle body that closed above the upper BB is more than Y pips, then do not Buy and remove the EA. Otherwise, continue to open Buy if crosses and close above upper BB and the number of positions is not more than Max No of Positions. The user will choose either Buy or Sell only. When price closes below the lower BB, close all
Hello freelancers here, I need an expert to help me with coding my script which is already working in pinescript, Moreover, i want a system whereby i can sell my trading bot and can give access with a license, I need an expert that can help me with this
Hello freelancers here, I need an expert to help me with coding my script which is already working in pinescript, Moreover, i want a system whereby i can sell my trading bot and can give access with a license, I need an expert that can help me with this, and my budget is $20, Thank you
Hello freelancers here, I need an expert freelancer to help me convert an expert advisor from MT4 to MT5. I have the MT4 source code, As for now i only got $15 for this project i don't have much on me at the moment, So i need someone who can work long terms cause i still have other projects i need him to work on for me
An EA based on Fibonacci 100 - 750 USD
I am in need of 3 EA based on Fibonacci re-tracement after a high or low is made,each EA will have a hedge trade on it.the hedge trade will be at the 50 percent of the Fibonacci..this will be present on all 3 EA, all three EA will have different levels of re-tracement, while the hedge trade will be a continuation (buy/sell stop), while the re-tracement trades will be (buy/sell limit)This EA must work on timeframe

Informazioni sul progetto

Budget
50 - 300 USD
Per lo sviluppatore
45 - 270 USD