[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 336

 
Elenn:
.... The question is how to organize arrays? If we declare all arrays on global level, it will take too much space in memory. Besides, this EA will be installed on each of 12 pairs, so it will be a very unproductive waste of memory. If only it were possible to delete arrays after they are no longer needed, but how to do it, especially from the global level?


If you have the source code, you can merge all three functions into one, and declare arrays in it.

After exiting this function, the memory will be freed automatically.

 

I can't figure out why the code doesn't work correctly on 4.

The task is to close all positions at a certain time of day and delete the pending orders placed by the EA. The problem is that every second order is not touched. There is no pattern. I cannot understand what the problem is. Please, tell me, what am I doing wrong? Thanks in advance for the answer!

   if (!ClosedByTime)
      if (CurrentHour==CloseTradesTime-1 && TimeMinute(TimeCurrent())>55)
            {
            ClosedByTime=true;
            for (n=0;n<=OrdersTotal()-1;n++)
               {
               OrderSelect(n,SELECT_BY_POS);
               if (OrderMagicNumber()==Magic)
                  { 
                  if (OrderType()==0 || OrderType()==1){
                     if (OrderType()==0)
                        {
                        OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),1);
                        Alert("BUY position has been closed due to tradetime timeout!");
                        }
                       else
                        {
                        OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),1);
                        Alert("SELL position has been closed due to tradetime timeout!");
                        }}
                     else {OrderDelete(OrderTicket());Alert("Pending order (type "+OrderType()+") has been canceled due to tradetime timeout!");}
                  }
               
               }
            }

P.S. Please don't respond with a "you're such a bullshit bullshitter..." :)

 
for(n=OrdersTotal()-1;n>=0;n--)
 

Hi all, how can I manage window properties from an indicator, I am interested in parameters marked with arrows, what functions to use for this?

 
sanches83:

Sorry to be so pushy, I just wanted to know if it's really not real or if it's just a lost topic.
I haven't used it, but there is a file "DDE-Sample.xls" included with the terminal, you only need to enable the server in the terminal. Try it, maybe it will work. Or maybe the task will be formulated differently. Or maybe the task will be formulated differently? Through API? Experiment with DDE.
 
FAQ:

Ahhhhhhhh I'm going to fall out of my chair now... I shouldn't have been so stupid.) I should work less at night...

Thank you.

 
If your Expert Advisor is very code-intensive... Does the speed of code processing - the speed of making decisions depend on the performance of the computer or even in spite of a very powerful computer, the processing speed will be limited by "the speed limit of the MKL4 language" (I don't know how to phrase it correctly)
 

Here is the code

int handle=FileOpen("1all.txt",FILE_WRITE|FILE_CSV,"\t");
  if(handle<0) {Print("FAQ"); return(0);}

  FileWrite(handle,"OrderTicket","OrderOpenPrice","OrderOpenTime","OrderSymbol","OrderLots");
  int total=OrdersHistoryTotal();

  for(int pos=0;pos<total;pos++)
    {
     if(OrderSelect(pos,SELECT_BY_POS,MODE_HISTORY)==false) continue;
     FileWrite(handle,OrderTicket(),OrderOpenPrice(),OrderOpenTime(),OrderSymbol(),OrderLots());
    }
  FileClose(handle);
  Print("done");

It doesn't give out an error. It seems to write everything, but I don't know where it saves. I searched for the file 1all.txt on my computer, but I couldn't find it. Where does it go?

 
Shniperson:
If your Expert Advisor is very code-intensive... Does the speed of code processing - the speed of making decisions depend on the performance of the computer or even in spite of a very powerful computer, the processing speed will be limited by "the speed limit of the MKL4 language" (I don't know how to phrase it correctly)

There are no particular problems for the optimal code. A curve can be 10 lines long and hang the system.
 
Alp:

Here is the code

It doesn't give out an error. It seems to write everything, but I don't know where it saves. I searched for the file 1all.txt on my computer, but I couldn't find it. Where does it go?


Which operating system? What drive is the terminal on?

By default.

\experts\files

\tester\files

Reason: