Need order management EA based on specified levels

MQL5 专家 期货

工作已完成

执行时间11 天
客户反馈
good communication

指定

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. 


反馈

1
开发者 1
等级
(34)
项目
60
23%
仲裁
11
73% / 9%
逾期
3
5%
空闲
2
开发者 2
等级
(119)
项目
169
38%
仲裁
9
78% / 22%
逾期
15
9%
空闲
3
开发者 3
等级
(236)
项目
418
34%
仲裁
53
36% / 40%
逾期
153
37%
繁忙
4
开发者 4
等级
(475)
项目
504
53%
仲裁
10
60% / 20%
逾期
3
1%
空闲
5
开发者 5
等级
(45)
项目
59
44%
仲裁
8
50% / 38%
逾期
7
12%
空闲
6
开发者 6
等级
(196)
项目
200
28%
仲裁
0
逾期
3
2%
工作中
7
开发者 7
等级
(16)
项目
29
48%
仲裁
0
逾期
6
21%
空闲
相似订单
Hi, I need a robot, which wil get instructions to trade in 3 symbols at the same time based on few parameters and calculations. Example: There is 1 symbol called Gold-Near and the rate for it is 1000-1002 If i specify that when the rate reaches 1050, it should sell 1 lot Upon execution it will have to sell 1 lot of cme gold, buy 3 lots of mcx gold and buy currently (lots will be based on calculation). All the
Starting from scratch, I need a solution to develop my own crypto trading and exchange platform. This platform should compare prices across various exchanges like Coinbase, Binance, KuCoin, and Unocoin, as well as different cryptocurrencies. The solution must identify opportunities to buy on one platform and sell on another for a profit, transferring funds to my personal wallet instantly for security. The bot should
Tradingview developer 30 - 35 USD
Hey greetings. I am in need of tradingview developer that can modify an open source PineScript indicator code to add additional features. Kindly bid for this project if it is what you handle and let proceed with the project
looking for help to get my ibkr automated, i have strategies already built in composer and have JSON for them, i really just need to he setup and explanation on how to maintain it and add new strategies
Specify your Requirements Specification here point by point. Try to describe your requirements briefly and clearly, so that your potential developer is able to correctly assess its complexity and cost, as well as the required execution time. A bad or too generic description will result in your order being ignored, or you will spend a lot of time negotiating the details with each applicant. Remember: It is better to
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
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
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

项目信息

预算
50 - 300 USD
开发人员
45 - 270 USD