6am Indicator

 

Hi

I hope I can explain this properly .... I want to write an indicator that plots a line from 6am one day until 6am the next day - the value to plot is the opening price at 6am. So I just get a series of horizontal lines from 6am one dat to 6am the next day. (I want to see if the price is above or below the price at 6am each morning)

Thanks in advance

Paul

 
Ok, what do you have so far?
 
phy wrote >>
Ok, what do you have so far?

just a shell - thanks ....

#property copyright "Paul Murfin"
#property link ""

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 White

int MaxBars = 1000;


#define CLOSE 4

double ExtMapBuffer1[];


int init() {

SetIndexStyle (0,DRAW_LINE,0,2);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexLabel (0," 6am Open");


return(0);

}

int deinit(){

return(0);
}

int start() {

int counted_bars=IndicatorCounted()-1;
int limit;
int iPeriod;

limit = counted_bars;
limit = MaxBars;


for (int i=0;i<limit;i++) {



ExtMapBuffer1[i] =


}


return(0);
}

 
for (int i=bars-1;i>=0;i--) {

   static double price;

   if(TimeHour(Time[i]) == 6 && TimeMinute(Time[i]) == 0) price = Open[i];

   ExtMapBuffer1[i] = price;

}

Should work on 1m 5m 15m 30m and 1h.

1m might not be reliable... if there is no bar at 6am.

 
phy wrote >>

phy
wrote
>>

phy
wrote
>>

great works a treat !!!! thanks again!

Reason: