Errors, bugs, questions - page 3189

 
Dominik Egert #:
That file is broken, you need to copy it again from your original source, or backup.

Hello, I lost the backup file because I formatted my hard disk and this is the recovered sample of my hard disk

 

Hi,

Since build 4260 I'm having problems with initial_volume in the backtester.

This code has always worked well, and now it's going wrong. Please help me out !


// ---------------------------------------------------------------------------------------------------
double COrders :: Get_Initial_Volume(long position_ID) 
{

   if (HistorySelectByPosition(position_ID))
   {
      for (int j=0; j<HistoryDealsTotal(); j++)
      {
         if( (deal_ticket=HistoryDealGetTicket(j)) >0) 
         { 
            double my_open_price    =HistoryOrderGetDouble(deal_ticket,ORDER_PRICE_OPEN); 
            string my_symbol = HistoryOrderGetString(deal_ticket,ORDER_SYMBOL); 
            double initial_volume_new = HistoryOrderGetDouble(deal_ticket,ORDER_VOLUME_INITIAL);
            Print (__FUNCTION__," initial initial_volume_new = ", DoubleToString(initial_volume_new,2), " deal_ticket = ", deal_ticket, " HistoryDealsTotal = ", HistoryDealsTotal(), " symbol =", my_symbol, " open_price = ", DoubleToString(my_open_price, Digits()));
         
            uint entry = (uint)HistoryDealGetInteger(deal_ticket,DEAL_ENTRY);
            if (!entry)
            {
               order_ticket      = (long)HistoryDealGetInteger(deal_ticket, DEAL_ORDER);
               initial_volume    = NormalizeDouble(HistoryOrderGetDouble(order_ticket,ORDER_VOLUME_INITIAL), DashBoard.LotDec); 
               Print (__FUNCTION__," initial volume = ", DoubleToString(initial_volume,2), " position_Volume = ", DoubleToString(position_Volume,2), " order_ticket = ", order_ticket);
            }
         }   
      }
   }
   return (initial_volume);
}   

It returns a positive deal_ticket, but initial_volume and open_price are 0

 
When I compile it gives this error. What should I do to fix the error? I appreciate. Attached is a photo of the error
Files:
 
farzad_protonuran #: When I compile it gives this error. What should I do to fix the error?

Functions do not magically appear when you write a call. Define your function and fix your warnings.

 
Forester #:

When creating a custom symbol, the following messages appear in the log

2017.12.26 21:56:49.908 HistoryCache 'EURUSD_c' bad file header or empty file [error: 0]
2017.12.26 21:56:49.908 HistoryBase 'EURUSD_c' invalid container (1970.01.01) found (off: 1208362, size: 63545, file: 15144)

I have 20 for a sample of 11 months. I assume that these 20 out of 500000 bars are fed to keep in the symbol defective. Maybe there is another reason...

How to find the bug?

Update:

The first time I run the symbol creation, the error does not occur. It happens on later runs.
Before restarting the symbol was deleted via the menu in the terminal, the 2016.hcc file is deleted, but the 2017.hcc file remains (when trying to delete to trash - reports that it is used by the terminal, even though the symbol is deleted).
Every time the symbol creation runs, this file is increased by 20 mb. 2016.hcc - deleted and re-created always the same size.

When closing the terminal, 2017.hcc can be deleted, and the first time a symbol is created after that - no errors.

Deleting via CustomSymbolDelete does not help remove 2017.hcc

Update:
Tried to manually create the symbol, copied EURUSD_M1_201612260004_201702021239 data into it, deleted the symbol. The 2017.hcc file is still there - it turns out that the problem is that the symbol is not deleted completely.
Checked on another computer with Win8 and August terminal v 1653 - same thing.

I am amazed no one has noticed this since August!!!


Sending to SD. I hope they do an update quickly, I think the situation is very critical if it's not just me repeating.

Cons of the current situation: not deleting, expanding file. I didn't check what data will be read, from first start or last one, if it was written differently and terminal counts from first symbol filling, it will be a mess.

PS. Answered. Will be fixed in new build.

I got the same error, how did you deal with it?

The same thing happens every week

 

Who deleted my documentation of the problem?

Run the indicator a) on chart - no problem!

But then b) start it in the debugger - crash due to an empty array :(

 
double Profit(mCSymbolInfo& sym, int sl, double Lot, double W, datetime t = 0)
  {
   double dbTickSize    = sym.TickSize(),
          dbTickValue   = mTickValue(sym.Name(),true,t),
          dbPointSize   = sym.Point();

   if(dbTickSize==0 || dbTickValue==0)
     {
      double pf;
      bool r            = OrderCalcProfit(ORDER_TYPE_BUY,sym.Name(),fNormalizeDouble(W*Lot,2),sym.Ask(),sym.Ask()+sl,pf);
      Print("Profit ",sym.Name(),": TickSize=",dbTickSize,", TickValue=",dbTickValue,", pf=",DoubleToString(pf,2),", pf check=",r);
      sym.Refresh();
      Print("Refresh Done");
      return EMPTY_VALUE;
     }
   double dbPointValue  = dbTickValue * dbPointSize / dbTickSize;           // Point value

   double tmp1          = fNormalizeDouble(W*Lot,2);
   double r1            = tmp1*(double)sl*dbPointValue;

   if(W!=0)
      if(t>=D'2024.06.21 13:35' && t<=D'2024.06.21 14:55')
        {
         double tmp        = SymbolInfoDouble(sym.Name(),SYMBOL_TRADE_TICK_VALUE);
         printf("sym.Name()=%s,dbPointValue=%.5f,sl=%i,Lot=%.2f,W=%.2f,tmp=%.5f,tmp1=%.5f,r=%.5f,TM(t)=%s, %.5f",
                     sym.Name(),dbPointValue,sl,Lot,W,tmp,tmp1,r1,TM(t),sl*dbPointValue);
        }

   return r1;
  }

2024.06.23 22:08:29.598 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62898,sl=158982,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.22613,TM(t)=2024.06.21 13:35, 99996.22613

2024.06.23 22:08:29.604 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62918,sl=158930,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.22490,TM(t)=2024.06.21 13:40, 99996.22490

2024.06.23 22:08:29.610 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62842,sl=159122,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.22945,TM(t)=2024.06.21 13:45, 99996.22945

2024.06.23 22:08:29.617 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62834,sl=159143,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.22995,TM(t)=2024.06.21 13:50, 99996.22995

2024.06.23 22:08:29.623 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62833,sl=159147,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23004,TM(t)=2024.06.21 13:55, 99996.23004

2024.06.23 22:08:29.629 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62818,sl=159183,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23090,TM(t)=2024.06.21 14:00, 99996.23090

2024.06.23 22:08:29.636 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62801,sl=159228,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23196,TM(t)=2024.06.21 14:05, 99996.23196

2024.06.23 22:08:29.642 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62799,sl=159232,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23206,TM(t)=2024.06.21 14:10, 99996.23206

2024.06.23 22:08:29.649 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62792,sl=159251,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23250,TM(t)=2024.06.21 14:15, 99996.23250

2024.06.23 22:08:29.657 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62740,sl=159382,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23560,TM(t)=2024.06.21 14:20, 99996.23560

2024.06.23 22:08:29.665 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62759,sl=159333,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23444,TM(t)=2024.06.21 14:25, 99996.23444

2024.06.23 22:08:29.673 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62710,sl=159457,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23737,TM(t)=2024.06.21 14:30, 99996.23737

2024.06.23 22:08:29.682 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62724,sl=159423,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23657,TM(t)=2024.06.21 14:35, 99996.23657

2024.06.23 22:08:29.691 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62715,sl=159446,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23711,TM(t)=2024.06.21 14:40, 99996.23711

2024.06.23 22:08:29.716 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62722,sl=159428,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23669,TM(t)=2024.06.21 14:45, 99996.23669

2024.06.23 22:08:29.725 3PairScannerVMvsW1 (USDJPY,M5) sym.Name()=USDJPY,dbPointValue=0.62734,sl=159398,Lot=1.00,W=1.00,tmp=0.62565,tmp1=1.00000,r=99996.23598,TM(t)=2024.06.21 14:50, 99996.23598


The result of multiplication is wrong. Can someone explain to me why? Thanks in advance

 

Is it possible to upload files to a MQL VPS?

Hi All,

My EA uses a file which it loads on initializing the EA.  When I migrate the EA, the initialization of the EA fails as the supporting file is not present on VPS.

How can I copy/migrate the supporting file to the VPS?

Thank you.

MetaTrader VPS
MetaTrader VPS
  • www.mql5.com
Reliable trading hosting for uninterrupted robot operations and instant trade copying
 
Capricorn14 #:

Is it possible to upload files to a MQL VPS?

Hi All,

My EA uses a file which it loads on initializing the EA.  When I migrate the EA, the initialization of the EA fails as the supporting file is not present on VPS.

How can I copy/migrate the supporting file to the VPS?

Thank you.

Never mind - I found the answer.

 
fxsaber #:

Can you tell me if this is a bug or not?

The i field is missing.

Yes the I field is missing. It's a bug