pl. correct this code for plotting horizontal lines

bharatk8

Active Member
#1
Following code plots horizontal lines for 1st bar O/C.I want these lines ONLY for CURRENT day.Pl. make changes in code.

tf = Param( "TF", 15, 1, 100000, 1 ) ;
Clrclose = colorCustom12 ;
Clropen = colorCustom12 ;
stylefirstbar = styleThick ;

tfs = tf * in1Minute ;
TimeFrameSet( tfs ) ;

firstbar = Day() != Ref( Day(), -1 ) ;
Cfirst = ValueWhen( firstbar, C, 1 ) ;
Ofirst = ValueWhen( firstbar, O, 1 ) ;
TimeFrameRestore() ;

Cfirste = TimeFrameExpand( Cfirst, tfs, expandFirst ) ;
Ofirste = TimeFrameExpand( Ofirst, tfs, expandFirst ) ;

Plot( Cfirste, "First bar Close", ClrClose, stylefirstbar ) ;//|styleNoRescale
Plot( Ofirste, "First bar Open", ClrOpen, stylefirstbar ) ;//|styleNoRescale
 

bharatk8

Active Member
#2
Following code plots horizontal lines for 1st bar O/C.I want these lines ONLY for CURRENT day.Pl. make changes in code.

tf = Param( "TF", 15, 1, 100000, 1 ) ;
Clrclose = colorCustom12 ;
Clropen = colorCustom12 ;
stylefirstbar = styleThick ;

tfs = tf * in1Minute ;
TimeFrameSet( tfs ) ;

firstbar = Day() != Ref( Day(), -1 ) ;
Cfirst = ValueWhen( firstbar, C, 1 ) ;
Ofirst = ValueWhen( firstbar, O, 1 ) ;
TimeFrameRestore() ;

Cfirste = TimeFrameExpand( Cfirst, tfs, expandFirst ) ;
Ofirste = TimeFrameExpand( Ofirst, tfs, expandFirst ) ;

Plot( Cfirste, "First bar Close", ClrClose, stylefirstbar ) ;//|styleNoRescale
Plot( Ofirste, "First bar Open", ClrOpen, stylefirstbar ) ;//|styleNoRescale
 

Similar threads