PureBytes Links
Trading Reference Links
|
This is a followup with some corrections on the code posted earlier.
Try this. Create it as a ShowMe not an Indicator. This solves the drawing
problem and counts down like 2,1,0 for a 3 minute bar and for 5 minute bar
4,3,2,1,0. It may still need some tweaking by someone who knows coding
better than I.
bobr
{Minutes_In_Bar coded by bobr bobrabcd@xxxxxxxxxxxxx 3/28/03}
Var: ref(0);
Var: ref2(0);
var: min_left("< ");
var: ct(0);
ct=timetominutes(currenttime);
min_left=("< "
+NumToStr(-barinterval+1+timetominutes(currenttime)-ct[1],0));
ref2=Text_New(D,T,C," ");
If lastbaronchart then begin
if value1=0 then begin
ref=Text_New(D,T,C," "); {get id}
value1=1;
end;
value2=Text_Delete(ref);
ref=Text_New(D,T+1,C, min_left);
Text_SetStyle(ref,0,2);
Text_SetColor(ref,7);
End;
----- Original Message -----
From: "Bilo Selhi" <biloselhi@xxxxxxxxxxx>
To: "Omega List" <omega-list@xxxxxxxxxx>
Sent: Thursday, March 27, 2003 9:19 AM
Subject: minutes left in bar indicator exercize
> here is a handy indicator that supposed to draw a text object that
displays minutes left in the bar to the right
> of the close of the last bar on chart. for example if time frame is 10
minutes, it will count from 10 to 1
> 10,9,8....1 to the right of the close of the bar telling you how many
minutes are left in the bar.
>
> however it does not work properly and also draws not only on last bar on
chart but on all previous bars
> in real time.
>
> could someone fix this problem to make it display only on the last bar in
real time, if possible.
> can be sort of a good exercise in EL.
>
> setup:
> *** set "space to the right" to 10 bars.
> load 5 min chart in real time.
> load indicator.
> observe "< n" to the right of the close, where n = number of minutes left
in the bar.
>
> post solution here.
>
> good trading.
> bilo.
|