Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1470

 
ANDREY:
This is my first post with my code.
And this is my
 
MakarFX:

In your code LoU changes onevery tickif price goes down, while my LoU changes only after opening a trade.

In your code LoU changes only after opening a deal........ but your code does not open orders 30 pips after each local low, exactly as my code does. I want my orders to open like in my code, but my LoU should not change at every tick or minute. And I want the EA to do much less work to open each order.

If you can, make your code open exactly the same orders as mine (by price, time and amount) for 04.01.2010, but LoU changes only after opening a deal, or do something else, greatly (several times) reduce the number of changes LoU
 
ANDREY:

In your code LoU changes only after opening a deal........ but your code does not open orders after 30 pps after each local low, exactly as my code does. I want my orders to open like in my code, but my LoU does not change on every tick or minute. And I want the EA to do much less work to open each order.

How do we define a local minimum if we do not check it on every tick or minute?
 
MakarFX:
How do you define a local low then, unless you check at every tick or minute?

That's what I'm puzzling over.....

Alternatively, if Bid - Low[?] > 30 pips to open an order. But how do we know the number of this Low[?]
 
ANDREY:

That's what I'm wondering.....

Why?

Tell me why you want to reduce the frequency of inspection?

 
MakarFX:
Why?

I have found one stable statistical pattern in the tester, which has been steadily producing profits with acceptable drawdowns since 2008. I need to test it on different pairs and frames etc.
But I need to test it using several parameters simultaneously. Optimization takes unreal much time. And I've already written a code that tests what I need much faster. And now I'm improving my code, i.e. I want it to work even faster in the tester, or as fast as possible. The main algorithm in my code is opening orders at 30 points after each local minimum. That is why I am trying to do it as quickly as possible.

 
MakarFX:

why?

Tell me why you want to shorten the check interval?

To make all the code execute faster.

 
MakarFX:
How do I define a local minimum if I do not check it on every tick or minute?

As an alternative, the function Low[iLowest(NULL,0,MODE_LOW,P1,0)] finds the minimum without checking the value of minima on every tick

I tried to use it, but it works only in some cases.

Or maybe there are some other constructs I do not know about and cannot make out with my own mind.

 
ANDREY:

I have found one stable statistical pattern in the tester, which has been producing stable profits with acceptable drawdowns since 2008. I need to test it on different pairs and frames etc.
But I need to test it using several parameters simultaneously. Optimization takes unreal much time. And I've already written a code that tests what I need much faster. And now I'm improving my code, i.e. I want it to work even faster in the tester, or as fast as possible. The main algorithm in my code is opening orders at 30 points after each local minimum. So I'm trying to do it as fast as possible.

The check in your code is not a load, but if you really want it, you may try it.

double LoU;
int OnInit()
  {
   LoU=Low[0];
  }
//+------------------------------------------------------------------+
void OnTick()
  {
   if(Low[1]<LoU) {LoU=Low[1];}
   if ((Bid-30*Point)>=LoU)
     {
      if(OrderSend(Symbol(),OP_SELL,0.1,Bid, 3,0,0,"300",0)) LoU=Low[0];
     }
  }
 
ANDREY:

As an alternative, the Low[iLowest(NULL,0,MODE_LOW,P1,0)] function finds the minimum without checking minima on each tick

Perhaps there are some other constructions I do not know about and cannot reach with my own mind

It depends on where to prescribe it.
Reason: