Experts: Alexav SpeedUp M1

 

Alexav SpeedUp M1:

Simultaneous opening of two opposite positions. Trailing Stop.


Author: Vladimir Karputov

 
Why did they add real ticks that spoil all the strategies? ))
 
Maxim Dmitrievsky:
Why did they add real ticks that ruin all the strategies? ))

Probably so that the market is not full of tester grails =)

 
Vitaly Muzichenko:

Probably so that the market is not swarming with tester grails =)

Yes!!!

 
No explanation for this discrepancy has been given. In what place exactly does the generated ticks look into the future?
 
//+------------------------------------------------------------------+
|| Trailing|
//+------------------------------------------------------------------+
void Trailing()
  {
   if(InpTrailingStop==0)
      return;
   for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of open positions
      if(m_position.SelectByIndex(i))
         if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic)
           {
            if(m_position.PositionType()==POSITION_TYPE_BUY)
              {
               if(m_position.PriceCurrent()-m_position.PriceOpen()>ExtTrailingStop+ExtTrailingStep)
                  if(m_position.StopLoss()<m_position.PriceCurrent()-(ExtTrailingStop+ExtTrailingStep))
                    {
                     if(!m_trade.PositionModify(m_position.Ticket(),
                        m_symbol.NormalizePrice(m_position.PriceCurrent()-ExtTrailingStop),
                        m_position.TakeProfit()))
                        Print("Modify ",m_position.Ticket(),
                              " Position -> false. Result Retcode: ",m_trade.ResultRetcode(),
                              ", description of result: ",m_trade.ResultRetcodeDescription());
                     continue;
                    }
              }
            else
              {
               if(m_position.PriceOpen()-m_position.PriceCurrent()>ExtTrailingStop+ExtTrailingStep)
                  if((m_position.StopLoss()>(m_position.PriceCurrent()+(ExtTrailingStop+ExtTrailingStep))) || 
                     (m_position.StopLoss()==0))
                    {
                     if(!m_trade.PositionModify(m_position.Ticket(),
                        m_symbol.NormalizePrice(m_position.PriceCurrent()+ExtTrailingStop),
                        m_position.TakeProfit()))
                        Print("Modify ",m_position.Ticket(),
                              " Position -> false. Result Retcode: ",m_trade.ResultRetcode(),
                              ", description of result: ",m_trade.ResultRetcodeDescription());
                    }
              }

           }
  }

What is the point of the highlighted?

When the original was written (2007), there was no MQL5 and, accordingly, no strict-directive in MQL4. That is why there is a much nested if construct there. At the moment, this has long been a rudiment. And since the KB carries training functions, there is no need to drag this relic into MQL5, so as not to cause ridicule among programmers of other languages.


If the original is rewritten to the current strcit-MQL4, its source code will be reduced by 1.5-2 times. In this sense, the MT5 variant is ***looks *** - 4 times larger in size than the original (this is still in the old MQL4). Why persistently make such an anti-advertisement of MT5!

 
fxsaber:
No explanation for this discrepancy has been given. In what place exactly is the looking into the future of the generated ticks?

It sounded a long time ago, here, section "Reference points".

 

This will not place a trade on my 5-digit ECN account. 


m

 
moneyfoundbymichael :

This will not place a trade on my 5-digit ECN account. 


m

If you do not trade - then of course: it will not affect :)