Hello Vladimir. Sorry for asking a question here, I can't open MT-5 after reinstalling Windows, because I didn't save my password when I changed my netting account to hedge. Could you please tell me what to do? The login is known.
Thank you.
Hello Vladimir. Sorry for asking a question here, I can't open MT-5 after reinstalling Windows, because I didn't save my password when I changed my netting account to hedge. Could you please tell me what to do? The login is known.
Thank you.
There's nothing to be done. It's cruel, but it's a good inoculation for the future: passwords and logins should be kept.
So I have to download a new one and register?
And if I don't already have a demo in Admiralmarketing?
Thank you.
I suspect that this function is written for the Netting account type, and the EA code is not designed for "Hedge accounts."
I suspect that this function is written for the Netting account type, and the EA code is not designed for "Hedge accounts."
From the description of the EA:
- So it should work on both accounts. Although it may have its own nuances for netting - and I would not recommend it for netting.
I don't think this is a good idea.
I don't think that's a good idea.
Thank you for sharing your opinion.
Dear Vladimir,
I made some code improvements for "MinProfitStep" and "MinProfitPercent" functions.
I think that with new codes EA will be able to get more efficient results from these functions. I would be glad if you share your opinion, suggestion or advice about the update.
else if (ExtMinProfitStep > 0) { int d=0; for(int i=PositionsTotal()-1; i>=0; --i){ if(m_position.SelectByIndex(i)){ // selects the position by index for further access to its properties if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic) { if(m_position.PositionType() != POSITION_TYPE_BUY && m_position.PositionType() != POSITION_TYPE_SELL) continue; int ActSide = m_position.PositionType() == POSITION_TYPE_SELL ? -1: +1; ulong ActTicket = m_position.Ticket(); double ActLot = m_position.Volume(); double LastOpenPrice = NormalizeDouble(m_position.PriceOpen(), _Digits); if (!HistorySelectByPosition(m_position.Identifier())) continue; if (HistoryDealsTotal() > 1){ ulong ActDealTicket = HistoryDealGetTicket(HistoryDealsTotal() - 1); LastOpenPrice = NormalizeDouble(HistoryDealGetDouble(ActDealTicket, DEAL_PRICE), _Digits); } if (ActSide * (NormalizeDouble(m_position.PriceCurrent(), _Digits) - (LastOpenPrice + ActSide * ExtMinProfitStep)) >= 0){ double lot_check=LotCheck(ActLot*InpMinProfitPercent); if(lot_check>0.0) m_trade.PositionClosePartial(ActTicket,lot_check); } } } } } }
What's that for?
if(ExtMinProfitStep > 0) { int d=0; for(int i=PositionsTotal()-1; i>=0; --i) { if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties { if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic) { int ActSide = (m_position.PositionType()==POSITION_TYPE_SELL)?-1:1; ulong ActTicket = m_position.Ticket(); double ActLot = m_position.Volume(); double LastOpenPrice = NormalizeDouble(m_position.PriceOpen(),m_symbol.Digits()); if(!HistorySelectByPosition(m_position.Identifier())) continue; if(HistoryDealsTotal() > 1) { ulong ActDealTicket=HistoryDealGetTicket(HistoryDealsTotal()-1); LastOpenPrice=NormalizeDouble(HistoryDealGetDouble(ActDealTicket, DEAL_PRICE),m_symbol.Digits()); } if(ActSide*(NormalizeDouble(m_position.PriceCurrent(),m_symbol.Digits())-(LastOpenPrice+ActSide*ExtMinProfitStep))>= 0) { double lot_check=LotCheck(ActLot*InpMinProfitPercent); if(lot_check>0.0) m_trade.PositionClosePartial(ActTicket,lot_check); } } } } }
why not use its method for a position
| Gets the price of opening a position |
?
- www.mql5.com
Hello Vladimir, sorry for the late reply.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Puria method:
A trading system based on the Puria method.
Author: Vladimir Karputov