Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 5

 
tara:
It's good that it's not. Take your program (any program) and make it run on half of the required memory.
Do you mean memory or speed of execution? I guess it depends on the processor as well.
tara:
I'm still here and not laughing. Answering the question. It's just, it's not as easy as I'd like it to be:)

Well, let's get started!
 
Gentlemen, good day to all! This question arises: the last function gives us (GetLotLastPos) the lot size of the previous position, how to attach this value to the action after the condition if (isLossLastPos()==true)
if (isLossLastPos()==true)
        {?????????????????}
            
              
     if (isLossLastPos()==false)
        
        {Vol=1;} 
    
    
    
    
     if ((Close[1]>Open[1]) && (OrdersTotal()<1) && (K==1))       
       
       {OrderSend(Symbol(),OP_BUY,Vol,Ask,10,Bid-sl*Point,Ask+tp*Point,"buy_order2",2,0,Blue); } 
}


 //+------------------------------------------------------------------+
//+------------------------------------------------------------------+

bool isLossLastPos(string sy="", int op=-1, int mn=-1) {
  datetime t;
  int      i, j=-1, k=OrdersHistoryTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (t<OrderCloseTime()) {
                t=OrderCloseTime();
                j=i;
              }
            }
          }
        }
      }
    }
  }
  if (OrderSelect(j, SELECT_BY_POS, MODE_HISTORY)) {
    if (OrderProfit()<0) return(True);
  }
  return(False);
}


    
double GetLotLastPos(string sy="", int op=-1, int mn=-1) {
  datetime o;
  double   x=-1;
  int      y, z=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (y=0; y<z; y++) {
    if (OrderSelect(y, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (o<OrderOpenTime()) {
                o=OrderOpenTime();
                x=OrderLots();
              }
            }
          }
        }
      }
    }
  }
  return(x);
}
 
With my question - while I'm polishing my code, I'm agonizing. I have the following theoretical question so far: has anyone on the forum already tried to extrapolate a Taylor series graph with polynomial degree to the width of the window? What are the results? I know that it is usually extrapolated using the polynomial of degree 5, but it has only 5-1=4 extrema and in theory it is applicable only to a window of 6 candlesticks or to a zigzag.
 

Please help... Who has encountered cases where, when trying to compile an EA in MetaEditor, an asterisk (multiply sign) suddenly appears at the top next to its name.

And nothing changes in the code or in the navigator, the compilation seems to hang!

And when I try to find it in the program files, it turns out that such an EA does not even exist, even though it trades in the Strategy Tester, in the demo mode and in the real account!

When I try to get to it through the MetaEditor, I get a padlock on the file and it refuses to get general access!

Please help me advice, what can or should be done?

 
Pasheda:

Please help... Who has encountered cases where, when trying to compile an EA in MetaEditor, an asterisk (multiply sign) suddenly appears at the top next to its name.

And nothing changes in the code or in the navigator, the compilation seems to hang!

And when I try to find it in the program files, it turns out that such an EA does not even exist, even though it trades in the Strategy Tester, in the demo mode and in the real account!

When I try to get to it through the MetaEditor, I get a padlock on the file and it refuses to get general access!

Please help me advice, what can or should be done?

Move the terminal folder from the system drive and "happiness be with you".
 

why does the tester on the new test follow the old tracks of the previous test?

the trades haven't gotten there yet, and all the profits and the lots are already drawn!!!

 
And because you saved them in a template.
 
FAQ:
And because you saved them in the template.

you saved them :)
who asked him to use the template to put trades on the chart?

what do we do now?

Delete the template? So I need it...

 
Load the template, remove all graphics from it (Ctrl+B\Ctrl+A\ delete button), save the template.
 
FAQ:
Load the template, delete all graphics from it, save the template.

so actually erase what I've saved?

great method! :))

but what if i need what i saved?

what do I do?

and then, there are 1000 different objects on it...how do i delete that many?

Reason: