Specification
I currently have a simple function in MT4, which sets a global take profit for the trades open and the hedged trades.
//--- Setup Global Take Profit if(was_trade) { orders_total = OrdersTotal(); for(index = orders_total - 1; index >= 0; index--) { if(!OrderSelect(index, SELECT_BY_POS, MODE_TRADES)) continue; if(OrderMagicNumber() != vInpMagic || OrderSymbol() != m_symbol) continue; order_type = OrderType(); if(m_direction > 0) { if(order_type == OP_BUY) res = OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), level, 0); if(order_type == OP_SELL) res = OrderModify(OrderTicket(), OrderOpenPrice(), level, 0.0, 0); } if(m_direction < 0) { if(order_type == OP_BUY) res = OrderModify(OrderTicket(), OrderOpenPrice(), level, 0.0, 0); if(order_type == OP_SELL) res = OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), level, 0); } } } }
In MT5, I have this which sets a Take Profit for the group of trades on one side. What I need is for this PIP_TP code to be able set a group take profit for the hedged trades as well (trades with a defined magic number, that is the same as the inverse side - but a Stop Loss instead of a take profit.
void PIP_TP(const string symb, int orderType = -1, long magical = 0) { double avg_price=0; double totprice=0; int Order_cnt=0; double lots=0; bool ticket=false; for(int cnt = 0; cnt < PositionsTotal(); cnt++) { if(position.SelectByIndex(cnt)) { if(position.PositionType()!= orderType) continue; if(position.Magic() != magical) continue; if(position.Symbol()!=symb) continue; Order_cnt++; lots+=position.Volume(); totprice += (position.PriceOpen()) * position.Volume(); } } if(Order_cnt==0) return; int digit= (int)SymbolInfoInteger(symb,SYMBOL_DIGITS); double ask = SymbolInfoDouble(symb, SYMBOL_ASK); double pipleveldiff = ask * 0.0001; double poin = NormalizeDouble(pipleveldiff, digit); if(Order_cnt == 10) // Max Trades poin = 0; if(Order_cnt > 0 && totprice!=0) avg_price = NormalizeDouble(totprice / lots, digit); for(int cnt = 0; cnt < PositionsTotal(); cnt++) { if(position.SelectByIndex(cnt)) { if(position.PositionType()!= orderType) continue; if(position.Magic() != magical) continue; if(position.Symbol()!=symb) continue; double current_takeprofit = position.TakeProfit(); if(position.PositionType()==OP_BUY && current_takeprofit != 0 && current_takeprofit < NormalizeDouble(avg_price+poin,digit)) continue; if(position.PositionType()==OP_SELL && current_takeprofit != 0 && current_takeprofit > NormalizeDouble(avg_price-poin,digit)) continue; if(position.PositionType()==OP_BUY && current_takeprofit != NormalizeDouble(avg_price+poin,digit)) { ticket=trade.PositionModify(position.Ticket(),position.StopLoss(),NormalizeDouble(avg_price+poin,digit)); // mod_cnt++; } if(position.PositionType()==OP_SELL && current_takeprofit != NormalizeDouble(avg_price-poin,digit)) { ticket=trade.PositionModify(position.Ticket(),position.StopLoss(),NormalizeDouble(avg_price-poin,digit)); // mod_cnt++; } } } if(ticket) ok++; }
Responded
1
Rating
Projects
172
23%
Arbitration
7
29%
/
43%
Overdue
4
2%
Working
2
Rating
Projects
226
22%
Arbitration
15
60%
/
20%
Overdue
1
0%
Loaded
3
Rating
Projects
180
32%
Arbitration
6
50%
/
50%
Overdue
2
1%
Working
4
Rating
Projects
475
40%
Arbitration
83
36%
/
33%
Overdue
13
3%
Busy
5
Rating
Projects
65
6%
Arbitration
25
20%
/
36%
Overdue
4
6%
Loaded
6
Rating
Projects
80
10%
Arbitration
35
9%
/
54%
Overdue
6
8%
Working
Similar orders
I need someone who knows how to code a semi auto Trade Panel Manager with hedging requirements
30+ USD
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
Trend Following with ML
50 - 200 USD
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
TREND TRACKER TRADER LOGIC
30+ USD
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
Project information
Budget
30+ USD
For the developer
27
USD
Deadline
to 1 day(s)