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

 

Dear colleagues, I am using this construction to identify extrema for the number of bars:

   double max = High[iHighest(NULL,0,MODE_HIGH,bars,1)];
   double min = Low[iLowest(NULL,0,MODE_LOW,bars,1)];

Can you tell me how to find bar numbers where extrema will be found? I mean the number of bars starting from the current zero.

 
CountTrades();

Number of open positions

I found this example on a forum.

extern bool UseSound  = true;
string CloseSound = "alert2.wav";

I decided to write as follows

int start() 
{
//-----
  int Counter=0;
  if(UseSound == true)
  {
    if(Counter>CountTrades())
    {
      PlaySound(CloseSound);
    }
    Counter=CountTrades();
  }
//-----

Probably not correct.

Thank you for your feedback.

 
Sancho77:

Dear colleagues, I am using this construction to identify extrema for the number of bars:

double max = High[iHighest(NULL,0,MODE_HIGH,bars,1)];
double min = Low[iLowest(NULL,0,MODE_LOW,bars,1)];

Can you tell me how to find bar numbers where extrema will be found? I mean bar numbers starting from the current zero.

int iHighest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)

Returns index of the highest value found(offset from the current bar).

Isn't that what you need?
 
I've tried in the office on 3 machines, all of them have the same problem. I tried in the office on 3 machines everywhere the same problem. before everything was open, security software was not changed. firewall and antivirus were turned off.
 
Reshetov:

Thank you, as there is no other option I will stick with this one.
 
T-G:
I've tried in the office on 3 machines, all of them have the same problem. I tried in the office on 3 machines everywhere the same problem. before everything was open, security software was not changed. firewall and antivirus were turned off.

I haven't encountered it yet, but I got a tip that you're being watched. The World Bank Consortium people are on their way. Prepare yourselves.
 
Roman.:

I haven't come across it yet, but I've received information that you are being followed. The World Bank Consortium people are on their way. Get ready.
You're all joking.)
 
Reshetov:
On ZigZag breaks. The point is that the breaks alternate one by one, i.e. upward movement, downward movement, upward movement, etc.

Honestly, I didn't quite connect your answer, Yuri, with my question.

In brief, I asked if the EA may have an analogue of the tester's function of checking on the history which TP and SL work better. That is, the tester looks at what triggers a take or stop and closes a position to profit or loss. Can such history check be implemented in an EA?

 
T-G:
I've tried in the office on 3 machines, all of them have the same problem. I tried in the office on 3 machines everywhere the same problem. before everything was open, security software was not changed. firewall and antivirus were turned off.
Probably the mass migration to MT5 is starting and brokers are slowly turning off demo-servers.
 
alexeymosc:

Honestly, I didn't quite connect your answer, Yuri, with my question.

In brief, I asked if the EA may have an analogue of the tester's function of checking on the history which TP and SL work better. That is, the tester looks at what triggers a take or stop and closes a position to profit or loss. Can this kind of history check be implemented in an EA?

No one forbids it. Somewhere in the Code Base there is a tester grail. There's just one pass in the tester and the next pass on the story will already be fine.