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

Re: Idea?: "Ticks left" not minutes left in bar indicator exercize



PureBytes Links

Trading Reference Links

Here is a little test you can do to verify what TimeToMinutes(Time) and
TimeToMinutes(CurrentTime) do.

Open a chart with a realtime symbol as data one.

Then insert a Custom 1 Line indicator with the Input1  Close changed to
TimeToMinutes(Time) and format it to screen and subgraph2 as a histogram or
line, should ramp upward.

Then in subgraph 3 insert another Custom 1 Line indicator and change the
Close to  TimeToMinutes(currenttime).

Time is the bar time.  Currenttime is clock time.  The TimeToMinutes
function converts each of those to the number of minutes elapsed since
midnight.  If you have a five minute bar chart and its 12 hours from
midnight, then the (Time) histograms
should have a value of 12*60=720.  The otherone (Currenttime) should be
720-5 to 720.  This showed my AM PM clock to be stuck out of phase with the
datafeed time.

bobr


----- Original Message -----
From: "Bilo Selhi" <biloselhi@xxxxxxxxxxx>
To: "Omega List" <omega-list@xxxxxxxxxx>; "Eduardo J Motta"
<motta@xxxxxxxxxx>
Sent: Friday, March 28, 2003 11:16 AM
Subject: Re: Idea?: "Ticks left" not minutes left in bar indicator exercize


> now that the tool's working the ideas can start poring:
>
> - marker can be used as a custom label for any custom indicator,
> example bar volume, tick volume, price levels, ticks left in bar, time
left in bar, alert triggered marker, etc...
>
> - those who are discretionary traders and use TS, buy and sell level color
coded text alerts can be coded such as
> <   es     meaning enter short with red color, < xs  meaning exit short
with magenta color, etc...
> colors and strings can be changed on a tick by tick basis when some custom
criteria is met.
>
> - can be used for real time debugging instead of print log window.
>
> here the version that will display how many ticks you got left in the bar,
works on tick charts.
> also added are inputs for marker and space.
> bilo.
> ps. anybody with other ideas, slow trading day...
>
> inputs:  marker ( "<" ),
>    space  ( "    ");
>
> var: text_string  ( "" ), { string }
>   ref   ( 0 ); { ref # of text object }
>
> { initialize text object }
> if currentbar = 1 then
>  ref = text_new(date,time,close, " " );
>
> if lastbaronchart then begin
>  { string for text object }
>  text_string = marker + space + numtostr(barinterval - ticks,0);
>  { move text to lastbaronchart }
>  text_setlocation(ref,date,time+1,close);
>  text_setstring(ref,text_string);
>  text_setstyle( ref, 0, 2 );
>  text_setcolor(ref, tool_yellow );
> end;
>
>
>
> ----- Original Message -----
> From: Eduardo J Motta
> To: Bilo Selhi ; BobR
> Sent: Friday, March 28, 2003 1:55 PM
> Subject: Idea?: "Ticks left" not minutes left in bar indicator exercize
>
>
> This is certainly a great tool.
>
> Thanks a lot for the work you both spent on this utility.
>
> There has been a while since I last used a Minute chart, most of the
indicators I use have been for looking at a
> smaller granularity, like tick level charts. Mostly 440, 220 and 70 tick
charts per asset
>
> Here is my question:  Any idea on how to adapt this nice tool to display
the number of bars left instead of
> minutes left for the next bar?
>
> Example:
>
> Assume I have and NQ or ES 70 tick chart
>
> as a new bar is being formed, I would like to have displayed the number of
ticks that are left for me to go to the
> next 70 tick bar. (so if 30 ticks have been used to form this particular
bar, the obvious answer would be 40 left till
> next bar.
>
> The only difference is that the way it is designed, it is using time as a
counter, and as I described above, a tick
> counter would be needed.
>
> Since I'm far a way from being an easylanguage specialyst, I would
certainly appreciate your help.
>
> Many thanks in advance
>
> Eduardo Jansson Motta
>
>
>
> On Fri, 28 Mar 2003 11:35:50 -0500, "Bilo Selhi" <biloselhi@xxxxxxxxxxx>
escreveu :
>
> > De: "Bilo Selhi" <biloselhi@xxxxxxxxxxx>
> > Data: Fri, 28 Mar 2003 11:35:50 -0500
> > Para: "BobR" <bobrabcd@xxxxxxxxxxxxx>, "Omega List"
<omega-list@xxxxxxxxxx>
> > Assunto: Re: minutes left in bar indicator exercize
> >
> > still same problem, it keeps the text on previous bars.
> > but i corrected the problem with text_setlocation function.
> > here is the correct version:
> >
> > var: min_left  ( "" ), { minutes left in bar }
> >   ref   ( 0 ); { ref # of text object }
> >
> > { initialize text object }
> > if currentbar = 1 then
> >  ref = text_new(date,time,close, " " );
> >
> > if lastbaronchart then begin
> >  { string for text object }
> >  min_left = "<          " + numtostr(timetominutes(time) -
timetominutes(currenttime),0);
> >  { move text to lastbaronchart }
> >  text_setlocation(ref,date,time+1,close);
> >  text_setstring(ref,min_left);
> >  text_setstyle( ref, 0, 2 );
> >  text_setcolor(ref, tool_yellow );
> > end;
> >
> >
> >
> > bilo.
> > ps. i use webtime utility to synch my computer clock to atomic clock
every time computer starts.
> >
> > ----- Original Message -----
> > From: BobR
> > To: Bilo Selhi ; Omega List
> > Sent: Friday, March 28, 2003 11:05 AM
> > Subject: Re: minutes left in bar indicator exercize
> >
> >
> > 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.
> >
> >
> >
> >
>