[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Bargraph display of timer to end of bar



PureBytes Links

Trading Reference Links

I thought I will contribute something to this group by publishing
a little utility I developed to visually see the end of bar
approaching in a thermometer type display using the empty space
at the right side of the chart. 

This is particularly useful to the WoodiesCCI group of people,
and fits neatly into the "Final CCI Panel for Amibroker" published
by DennisAndLisa.

The display changes colors at 20% and 10% of Interval() in the
following
manner:

  . . . .  

> 20%    |         20% to 10% >       |     10%       |   <     less
than 10% left > | BarEnd, ... 
i.e for 5 min bar:                       |    30sec      |   .   .   .
..   .    .     
 

The code to produce this display is:
(The color scheme I use is white background, it will probably look ok
on a dark background too).

////////////////////////////////////////////////////

IsLastBar = BarIndex() == LastValue( BarIndex() );

PrecentBarLeft = TimeRem[BarCount-1] / Interval() ;

 

PlotTimerBars = ParamToggle("plot remaining Time
thermometer?","No|Yes",1);

 

if (PlotTimerBars >0) 

{

TimerColor = IIf ((PrecentBarLeft > 0.1), colorBlue,colorLime);

TimeBkgrColor= IIf ((PrecentBarLeft > 0.2), colorYellow, colorBlue);

 

FS = IIf(PrecentBarLeft>0.2, 1.0, (IIf(PrecentBarLeft>0.1, 0.2,
0.1)));

 

Plot(IIf(IsLastBar AND TimeBkgrColor == colorYellow,0.6,Null),"!",
colorRed,

       styleArea+styleOwnScale+styleNoLabel+styleNoTitle,0,2.00,1) ;

Plot(IIf(IsLastBar AND TimeBkgrColor == colorYellow,0.54,Null),"!",
colorWhite,

       styleArea+styleOwnScale+styleNoLabel+styleNoTitle,0,2.00,1) ;

Plot(IIf(IsLastBar,0.5,Null),"TimerBkgrnd", TimeBkgrColor,

       styleArea+styleOwnScale+styleNoLabel+styleNoTitle,0,2.00,1) ;

Plot(IIf(IsLastBar,0.5*(1-PrecentBarLeft/FS),Null),"TimerBar",
TimerColor,

       styleArea+styleOwnScale+styleNoTitle+styleNoLabel,0,2.00,1) ;
// +styleNoLabel

}

 

////////////////////////////////////////////////////


Joseph Biran
____________________________________________