Highest

 

Hi Guy,

I am learnig and I don't know how I have to code the previous highest of 1 day to trigger the Entry.

I used  this code in declarion of variable:

int HighDayBefore= iHighest(NULL, PERIOD_H1, MODE_HIGH, 24, 0);

and then the array double HH=High[HighDayBefore]. But it doesn't buy at that condition.


I will show you the picture 

 
Are you looking for the previous day high or the high of the last 24 H1 candles?
 
Keith Watford:
Are you looking for the previous day high or the high of the last 24 H1 candles?

Hi, Keith 

thank you first of all.

Well, previous highest in hour chart.

can you help me please

 

louisc85:

int HighDayBefore= iHighest(NULL, PERIOD_H1, MODE_HIGH, 24, 0);
double HH=High[HighDayBefore].
 But it doesn't buy at that condition.
  1. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your (original) post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  3. Those lines do not give the previous day's high, it returns the high of the last 24 hours including the current forming bar. Not the same unless this is the last tick of the day, which can't be done. You could use bar one through 24 if this is the first bar of the new day, but you don't check for that.
  4. Code fails if the chart is not on the H1, (4066/4073 errors.)
  5. Find yesterdays bars:
       INDEX iBOD = iBarShift(_Symbol, _Period, date() );         // Beginning of the day.
    INDEX iEOY = iBOD - 1;                                        // End of Yesterday.
    INDEX iBOY = iBarShift(_Symbol, _Period, date(Time[iEOY]) );  // Beginning of Yesterday.
    INDEX iHOY = iHighest(_Symbol, _Period, iBOY-iEOY+1, iEOY);   // High of Yesterday.
    double HH=High[iHOY];                                         // High price of Yesterday.
              Find bar of the same time one day ago - Simple Trading Strategies - MQL4 and MetaTrader 4 - MQL4 programming forum

  6. As for "it doesn't buy" your posted code has nothing to do with trading. Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.
 

ok sorry for the post.

 
is there any non period indicator study.?