Get High of previous week

 

I am wondering how to get the high of the previous week for NY trading hours (i.e. close Fri 1PM).

I am also a little confused if it is possible to write a program that, for example, looks at last weeks high/low and compares to todays open (not current tick). This is just one part of the algo, but I can figure out the rest from this example.

I would like to just have a window pop up and say (for example EUR/USD buy at x.xxxx, stop at x.xxxx), you get the idea. I don't necessarily need it hooked to a chart, but just something that can run. I guess that would make it a customer indicator, but it seems indicators need to be attached to a specific pair.


Thanks

 

iHigh() & iLow() + MessageBox() can do job 4 u

 
qjol:

iHigh() & iLow() + MessageBox() can do job 4 u


Thanks,

I got this to work, sort of...

if(DayOfWeek()==0 && Volume[0]==1) // First tick of new week
   {
      //CurrentWeekOpen=Open;
      // get close of week
      LastWeekOpen=iOpen(NULL,PERIOD_W1,1);
      LastWeekHigh=iHigh(NULL,PERIOD_W1,1);
      LastWeekLow=iLow(NULL,PERIOD_W1,1);
      LastWeekClose=iClose(NULL,PERIOD_W1,1);
       
   }

It seems though that the the data conflicts with what the real data is. I am using ibfx demo account if that matters, but for example,

the EUR/USD shows 10/17 open is 1.3951, when in reality it was 1.3971 (it seems that the ibfx data has a 2 hour sunday time frame that doesn't show as Sunday?)

Something is wrong, but I can't figure out if it is bad data or bad programming logic.


Thanks

 

Volume[0]==1

could be a problem because if there is a gap or 2 ticks together

 

Volume is in reliable. Use Time[]

    static datetime Time0;  bool    newBar  = Time0 < Time[0];
    if (Bid > CA.below && Bid < CA.above && (!newBar)) return(0);
    // Don't call me again until the next special case.
    #define INF 999999  // Don't call me again until the next special case.
    Time0 = Time[0];    CA.below = 0;   CA.above = INF;