Experts: Puria method

 

Puria method:

A trading system based on the Puria method.

Puria method

Author: Vladimir Karputov

 
Automated-Trading:

Puria method:

Author: Vladimir Karputov

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.

 
Shara1:

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 you can do. It's cruel, but it's a good inoculation for the future: passwords and logins should be kept.
 
Vladimir Karputov:
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.

 
Hello Vladimir,

- "MinProfitStep (Minimum profit step, in pips)"
- "MinProfitPercent (Coefficient lot taking at "Minimum profit step")."

I believe that these functions are not working efficiently or are not working correctly.
I suspect that this function is written for the Netting account type, and the EA code is not designed for "Hedge accounts."

Can you check if this function works correctly on "hedge" type accounts ?

Thanks

 
Edviao:
Hello, Vladimir,

- "MinProfitStep (Minimum profit step, in pips)"
- "MinProfitPercent (Coefficient lot taking at "Minimum profit step")"

I believe these functions are not working efficiently or working correctly.
I suspect that this function is written for the Netting account type, and the EA code is not designed for "Hedge accounts."

Can you check if this function works correctly on "hedge" type accounts ?

Thanks

From the description of the EA:

Holds no more than one position in the market - so it can be recommended for both netting and hedge accounts.

- So it should work on both accounts. Although it may have its own nuances for netting - and I would not recommend it for netting.

 
Hello Vladimir,
Would it make sense to add the following function to this EA?

Thank you.

"TrailingFrequency = 10; (Trailing, in seconds (< "10" -> only on a new bar)"
 
Edviao:
Hello, Vladimir,
Would it make sense to add the following function to this EA?

Thank you.

"TrailingFrequency = 10; (Trailing, in seconds (< "10" -> only on a new bar)"

I don't think this is a good idea.

 
Vladimir Karputov:

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

PriceOpen

Gets the price of opening a position


?

Документация по MQL5: Стандартная библиотека / Торговые классы / CPositionInfo / PriceOpen
Документация по MQL5: Стандартная библиотека / Торговые классы / CPositionInfo / PriceOpen
  • www.mql5.com
PriceOpen - CPositionInfo - Торговые классы - Стандартная библиотека - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

Hello Vladimir, sorry for the late reply.

This is to find out the last partial closing price.