Errors, bugs, questions - page 1898

 
fxsaber:

This EA's lot selection is affected by any third-party trading (including other instances) on the original symbol.

In this piece this happens

Forgot to attach the file, now added in . There

double TradeSizeOptimized(void)
  {
   double price=0.0;
   double margin=0.0;
//--- select lot size
   if(!SymbolInfoDouble(_Symbol,SYMBOL_ASK,price))
      return(0.0);
   if(!OrderCalcMargin(ORDER_TYPE_BUY,_Symbol,1.0,price,margin))
      return(0.0);
   if(margin<=0.0)
      return(0.0);

   double lot=NormalizeDouble(AccountInfoDouble(ACCOUNT_MARGIN_FREE)*MaximumRisk/margin,2);
//--- calculate number of losses orders without a break
   if(DecreaseFactor>0)
     {
      //--- select history for access
      HistorySelect(0,TimeCurrent());
      //---
      int    orders=HistoryDealsTotal();  // total history deals
      int    losses=0;                    // number of losses orders without a break

      for(int i=orders-1;i>=0;i--)
        {
         ulong ticket=HistoryDealGetTicket(i);
         if(ticket==0)
           {
            Print("HistoryDealGetTicket failed, no trade history");
            break;
           }
         //--- check symbol
         if(HistoryDealGetString(ticket,DEAL_SYMBOL)!=_Symbol)
            continue;
         //--- check Expert Magic number
         if(HistoryDealGetInteger(ticket,DEAL_MAGIC)!=MA_MAGIC)
            continue;
         //--- check profit
         double profit=HistoryDealGetDouble(ticket,DEAL_PROFIT);
         if(profit>0.0)
            break;
         if(profit<0.0)
            losses++;
        }
      //---
      if(losses>1)
         lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
     }
 
Rashid Umarov:

Forgot to attach the file, now added to . There

Yes, that's what it was about. That is correct.

True, I would have written it differently (not compiled).

//--- calculate number of losses orders without a break
   if((DecreaseFactor>0) && HistorySelect(0,TimeCurrent()))
   {
      int    losses=0;                    // number of losses orders without a break

      for(int i=HistoryDealsTotal()-1;i>=0;i--)
      {
         ulong ticket=HistoryDealGetTicket(i);

         if((HistoryDealGetString(ticket,DEAL_SYMBOL)!=_Symbol) &&
            (HistoryDealGetInteger(ticket,DEAL_MAGIC)!=MA_MAGIC))
         {
           double profit=HistoryDealGetDouble(ticket,DEAL_PROFIT);
           if(profit>0.0)
              break;
           else if(profit<0.0)
              losses++;
         }
      }
      //---
      if(losses>1)
         lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
   }


I'll take this opportunity to ask you and other contributors, what MT5 advisors in kodobase are there that use history in their trading logic?

 

Tired of MT5 - lags terribly - only 11 windows open - standard indicators.

What to do - on large movements just hangs....


2017.05.24 18:02:43.549 Terminal Opening Broker x64 build 1596 started
2017.05.24 18:02:43.550 Terminal Windows 7 Ultimate (x64 based PC), IE 10.00, AMD Processor Model Unknown, RAM: 9782 / 16357 Mb, HDD: 22385 / 114470 Mb, GMT+03:00

More than 100 windows and 50 tumblers open in Quicksave - CPU load 1-5% there
 

AMD Processor Model Unknown

When starting up the PC and in Windows, is the CPU also detected?

 
Vladimir Zubov:

AMD Processor Model Unknown

When starting up the PC and in Windows, is the CPU also detected?

When starting the PC the processor is not detected - it is only in the bios, but I will not look it up now.

Windows says so, as MT5.

Real CPU is AMD Phenom II 960T (overclocked 3,5 Mhz) , but one core is unlocked - it turns out five in total.

 

The terminal is installed on an SSD hard drive.

 

Turns out that heavy CPU utilisation only occurs on a real account - any ideas?

 

The terminal is dead, I can't close the oil and RTS futures position - what a mess!

 
-Aleks-:

The terminal is dead, I can't close the oil and RTS futures position - what a mess!


And from a mobile phone?
 
-Aleks-:

The terminal is dead, I can't close the oil and RTS futures position - what a mess!

If critical, you can close from Quick or by phone.

I haven't seen this for a long time (including today on oil), but I don't have indicators on my charts anymore.

Reason: