[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 139

 

Here are the indicators and templates. I hope to help someone.

http://depositfiles.com/folders/8KVJ9L02I

 

SOS!? Could you please explain to the Expert Advisor

the VolumeHist indicator values (vertical volumes) i.e. to determine them on the chart

or just counting? (if he calculates it, he needs a block to analyze the ~budget price and calculate the value of this indicator)

for example, an Expert Advisor thinks and the result is BUY.LONG

i need to find a couple of extremums and choose the best one, right?

if you have any experience with this indicator in the automated system, plz share!


 

Hello.

I can't think at first glance whether it is possible:

There is a function - it returns true, when the conditions are met
e.g., C[0]>C[1]+n*Point (exactly C[0], hence the question).

How can I specify in this function, that even if the condition is executed once,

condition, true will return a certain amount of time (X).

Thank you.

 
Telemah >> :

Hello.

I can't think at first sight whether this is possible :

There is a function - returns true,when conditions are met
e.g. C[0]>C[1]+n*Point (exactly C[0], hence the question).

How can I specify in this function, that even if the condition is executed once,

one-time execution of a condition, true will return a certain time (X).

Thank you.


You can't. MQL4 is not an OOP. Therefore, the function can return only one value.

But, there are several workarounds:


1. Send an array to the function by reference and store the required values in it during the execution of the function, in order to read them later.

2. declare static variables, enter values into them during function execution and read them after

 
Reshetov >> :

You cannot. MQL4 is not an OOP. Therefore the function may return only one value.

But, there are several workarounds:


1. Pass an array by reference to a function and store the required values in it during the execution of the function, so that they can be read later.

Declare static variables, enter values into them at the function execution time and read them after

Thank you for your reply.

 
Gentlemen, advise what the problem, it is necessary that each newly appeared pending delete the previous one, it seems right, but it does not work as it should, if there is a pending for buy, then the pending for sale it removes (and vice versa), and if there is to buy and there is a new to buy (ie in the same direction) does not work cheh (with the sale plus sale the same thing). I do not understand something, what is wrong?
bool SELLSTOP; bool BUYSTOP;
  if(...... && BUYSTOP == false)
     {
     int BuyTicketStop = OrderSend(Symbol(),OP_BUYSTOP, Lots, SB,4, SB - StopLoss*Point, SB + TakeProfit*Point,"Покупаем",658932,0,Green);
        if ( BuyTicketStop > 0)
        {
        BUYSTOP = true;
        PlaySound("recharge.wav");
        }
        else 
        {
        Print("Ошибка: ", Error(GetLastError()));
        PlaySound("timeout.wav");
        }
      }  

  if(....... && SELLSTOP == false)
     {
     int SellTicketStop = OrderSend(Symbol(),OP_SELLSTOP, Lots, SS,4, SS + StopLoss*Point, SS - TakeProfit*Point,"Продаем",658932,0,Red);
        if ( SellTicketStop > 0)
        {
        SELLSTOP = true;
        PlaySound("recharge.wav");
        }
        else 
        {
        Print("Ошибка: ", Error(GetLastError()));
        PlaySound("timeout.wav");
        }
     }
     
 int M;
 for( M = OrdersTotal() - 1; M >= 0; M--)
     {
     OrderSelect( M, SELECT_BY_POS, MODE_TRADES);
     
          if ( SELLSTOP == true){if(OrderType() == OP_BUYSTOP) 
          {bool ODBS = OrderDelete(OrderTicket());
          if( ODBS){ BUYSTOP = false; PlaySound("ok.wav");}
          else { BUYSTOP = true; Print("Ошибка: ", Error(GetLastError())); PlaySound("timeout.wav");}}}
          
          if ( BUYSTOP == true){if(OrderType() == OP_SELLSTOP) 
          {bool ODSS = OrderDelete(OrderTicket());            
          if( ODSS){ SELLSTOP = false; PlaySound("ok.wav");}
          else { SELLSTOP = true; Print("Ошибка: ", Error(GetLastError())); PlaySound("timeout.wav");}}}
 
 

Good afternoon. Question for the experts.

I am optimising with a variable spread.

How does the tester consider the spread during optimization?

Does it consider the new current spread in each run?

Or all optimization runs are performed considering the spread memorized by the tester before pressing the OPTIMIZATION button?

 
Rita писал(а) >>

Good afternoon. Question for the experts.

I am optimising with a variable spread.

How does the tester consider the spread during optimization?

Does it consider the new current spread in each run?

Or all optimization runs are based on the spread memorized by the tester before pressing the OPTIMIZATION button?

Is the last known one used?

 
Rita писал(а) >>

Good afternoon. Question for the experts.

I am optimising with a variable spread.

How does the tester consider the spread during optimization?

Does it consider the new current spread in each run?

Or all optimization runs are based on the spread memorized by the tester before pressing the OPTIMIZATION button?

Is the last known one used?

 

Thank you. But it's still not quite clear.

Last known before each run?

Or the last known before the start of optimisation ?

Reason: