Spécifications
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++; }
Répondu
1
Évaluation
Projets
172
23%
Arbitrage
7
29%
/
43%
En retard
4
2%
Travail
2
Évaluation
Projets
226
22%
Arbitrage
15
60%
/
20%
En retard
1
0%
Chargé
3
Évaluation
Projets
180
32%
Arbitrage
6
50%
/
50%
En retard
2
1%
Travail
4
Évaluation
Projets
475
40%
Arbitrage
83
36%
/
33%
En retard
13
3%
Occupé
5
Évaluation
Projets
65
6%
Arbitrage
25
20%
/
36%
En retard
4
6%
Chargé
6
Évaluation
Projets
80
10%
Arbitrage
35
9%
/
54%
En retard
6
8%
Travail
Commandes similaires
Connect from Mt5 via binary deriv account api
30 - 50 USD
Connect from Mt5 via binary deriv account api I have mt5 indicator, need to connect with binary deriv account through api. If anyone can setup via API then contact me. everything control mt5
50% Retracement Indicator
30 USD
Hello I am looking for a developer to create an 50% retracement Indicator of the previous candle . So once a candle close the Indicator is supposed to take the full candle size from high to low and make a 61% and 50% level on that candle and I would like the candle to show until the next previous candle is done creating. After this I would look to create an ea with it possibly
Hi, I have 2 indicators which are based on the super trend , the alerts on indicator (1) does not work at all , and on the other indicator the alerts do not come on time on time, which is kind of delayed. see attached file below
Looking for an experienced developer to modify my existing TDI strategy , want to add filter for Buy and Sell Signals, Arrows are displayed on chart and what only to leave high accurate arrows Source code to be provided
I have the mq5 file, I need a buffer adding to the indicator, so it appears in the data window so I can reference it later in an EA. As the below screenshot shows, there is a median ray line from yesterday (the dashed horizontal line) - I want this value in the data window called Median Ray. I want this to be a single value per day, so todays Median Ray would be 17868, and so on each day. So I want all the Developing
Creating an indicator for metatrader 4
30 - 50 USD
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to
Indicator Conversion
30+ USD
I urgently require swift assistance to convert a complex indicator into a fully functional scanner, capable of automatically sending real-time data, alerts, and notifications via email, ensuring seamless integration and prompt delivery of critical information to facilitate informed decision-making and timely action
Make indicator lighter/faster
30+ USD
I need to improve the code of an indicator that is too heavy and slow when running and when used with iCustom in an EA. No other changes to the indicator are requested: the original features of the indicator should remain as theay are. I'll provide the indicator after job acceptance. I request final source code mq5 file. Thank you Regards
I have a mt5 indicator that is working perfectly but I will like to make it an expert advisor to have an automated trade. I will be glad if I can get a well experienced developer to execute this project. Thanks
O TRABALHO CONSISTE NA MUDANÇA DO HISTOGRAMA DO INDICADOR TREDN DIRECTION AND FORCE DSEMA SMOOTHED PARA O HISTOGRAMA DA FOTO ANEXA, OBEDECENDO AS TRES CORES VERDE (UP, VERMELHOR(DOWN) E CINZA(TREND). O MESMO TEM QUE ODECER O MESMO CALCULO E COLORIR DA MESMA FORMA POREM COM HISTOGRAMA DDE FORMATO DIFERENTE
Informations sur le projet
Budget
30+ USD
Pour le développeur
27
USD
Délais
à 1 jour(s)