Drawing Horizontal line on M5

 
Hi
I would like to draw Horizontal line on M5 based on H4 Open High Low Close of the last bar.
Which mean is . Once the H4 bar formed I want to draw a 4 lines on 5m chart ( Open / High / Low / Close )

Problem is I know how to draw a line but i don't know how to get H4 last bar Information in the code..


thanks
 
sillykiddo wrote >>
Hi
I would like to draw Horizontal line on M5 based on H4 Open High Low Close of the last bar.
Which mean is . Once the H4 bar formed I want to draw a 4 lines on 5m chart ( Open / High / Low / Close )

Problem is I know how to draw a line but i don't know how to get H4 last bar Information in the code..


thanks


// will help you more maybe...
 
sillykiddo:
Hi
I would like to draw Horizontal line on M5 based on H4 Open High Low Close of the last bar.
Which mean is . Once the H4 bar formed I want to draw a 4 lines on 5m chart ( Open / High / Low / Close )

Problem is I know how to draw a line but i don't know how to get H4 last bar Information in the code..


thanks


try
iOpen(Symbol(),Period_H4,1)
iClose(Symbol(),Period_H4,1)
iHigh(Symbol(),Period_H4,1)
iLow(Symbol(),Period_H4,1)

 
Have not tested, but this might work.
double H4Open = iOpen(NULL, PERIOD_H4, 1);
double H4High = iHigh(NULL, PERIOD_H4, 1);
double H4Low = iLow(NULL, PERIOD_H4, 1);
double H4Close = iClose(NULL, PERIOD_H4, 1);


ObjectCreate ( "H4Open" , OBJ_HLINE , 0 , 0 , H4Open ) ;
ObjectSet ( "H4Open" , OBJPROP_COLOR , Red ) ;
ObjectSet ( "H4Open" , OBJPROP_STYLE , 2 ) ;
ObjectSet ( "H4Open" , OBJPROP_BACK , 0 ) ;

ObjectCreate ( "H4High" , OBJ_HLINE , 0 , 0 , H4High ) ;
ObjectSet ( "H4High" , OBJPROP_COLOR , Blue ) ;
ObjectSet ( "H4High" , OBJPROP_STYLE , 2 ) ;
ObjectSet ( "H4High" , OBJPROP_BACK , 0 ) ;

ObjectCreate ( "H4Low" , OBJ_HLINE , 0 , 0 , H4Low ) ;
ObjectSet ( "H4Low" , OBJPROP_COLOR , Magenta ) ;
ObjectSet ( "H4Low" , OBJPROP_STYLE , 2 ) ;
ObjectSet ( "H4Low" , OBJPROP_BACK , 0 ) ;

ObjectCreate ( "H4Close" , OBJ_HLINE , 0 , 0 , H4Close ) ;
ObjectSet ( "H4Close" , OBJPROP_COLOR , White ) ;
ObjectSet ( "H4Close" , OBJPROP_STYLE , 2 ) ;
ObjectSet ( "H4Close" , OBJPROP_BACK , 0 ) ;