Code for go up breaking the eight bar higher:

 
I'm new MQL4. I do not know where to post my question ... How do I create asimple command code to go up breaking the bar higher eight? Thanks with Greetings from Italy. Help me! Mauritius.
 

Welcome.

"bar higher eight" didn't translate. I assume you mean when the price breaks above the high of the last 8 bars.

int    iHH = Highest(NULL,0, MODE_HIGH, 8, 1);
double HH  = High[iHH];
if (Bid > HH){ 
   Print("Higher than last 8 bars");
}
 
WHRoeder:

Benvenuto.

"Bar superiore a otto" non tradurre. Presumo che significa quando il prezzo rompe sopra il massimo degli ultimi 8 bar.



Thank's WHR from Italy!

 
the code is wrong, does not work!
 
CRAY:
the code is wrong, does not work!
Looks good to me . . . . maybe you should show how you have used it in your code.
 
//+------------------------------------------------------------------+
//| alt0 rottura 2.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property link "BBB"

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int iHH = Highest(NULL,0,MODE_HIGH,8,1);

double HH = High[iHH];

if (Bid> HH){

Print("Higher than 8 bars");

}
 

Erm . . . maybe you need a start() function ? perhaps you need to read the book first: Book, in particular: start

What WHR gave you was a code snippet . . . not a whole working EA, Script or Indicator . . .

 
I need a function of starting to run the script on the graph.
 
So write one. No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
 
CRAY:
I need a function of starting to run the script on the graph.
OK, learn from the Book or try here: Code this for me quick
Reason: