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

RE: [amibroker] Maintaining cursor position between time frames


  • Date: Tue, 8 Dec 2009 16:16:39 -0600
  • From: "Joris Schuller" <jschuller@xxxxxxxxxxx>
  • Subject: RE: [amibroker] Maintaining cursor position between time frames

PureBytes Links

Trading Reference Links

Neil/Reinsley,
I don't know whether this is what you are looking for or that you want
something different. Let me know. I have some stuff with foreign symbols
what might be closer to what you want.
Below the afl from Brucer/Bisto.  Apart from minor editing nothing was
changed.

The Zoomer.
The Zoomer takes a little bit of getting used to, but the thing does work.

Create  a number of windows: For example, 5 Min,15 Min and 1 Hr timeframes
(W1,W2,W3).
There are several modes: Zoomer On/Off and Single and Multiple windows
activated.
Zoomer On/Off:  Zoomer can be activated in the parameter window. Each window
can be activated inividually. The Reset All button is somewhat misleading
since it only turns off the Zoomer in the activated window and has to be
repated for each window with Zoomer On.
Zoomer Off: Clicking in one of the three windows results in a synchronized
Selected Value Line (SVL) to appear in all 3 windows at the same time (of
course when out of view, scrolling is required). Time ranges can be selected
inidividually.  Works fine.
Zoomer On. 
One Window with Zoomer On. Zoomer On is selected in the parameter window for
the activated window. All the zooming action takes place from the activated
Zoomer window.   After selection, the other 2 windows are adjusted such that
they cover the same time range as the selected window (its time range stays
unchanged).  So in this example W1(5 Min) will have approximately 12X as
many bars as W3(1 HR).  Changes in the visible range when made from the
Zoomer Window are all transferred to the other windows. So, the ranges of
the unselected windows are synchronized with the selected window if the
range is changed from the Selected Zoomer Window. 
However, ranges can be freely changed in the windows with Zoomer Off from
their own time axis to look at other areas. Cursor synchronization can be
done from each window, regardless of Zoomer condition.    Occasionally
Zooming doesn't work immediately: Click on the left or right arrows in the
time axis or on the time axis (or the title bar) and it will respond.
Multiple windows with Zoomer On.  Initially I thought that multiple
simultaneous Zoomer selection would provide more flexibilty. However,
although on occasion there is the capability to toggle between the
pre-synchronization time range and the synchronized time range there are
also time axis issues, wrong and oscillating displays, so I stopped using
it.

//=================================Begin of Code
(BruceR/Bisto)===================================
/*
Hi,
here I am with a slightly different Version of the BruceR's function to
avoid the undesired zooming when scrolling left at the left edge AND to let
to show the blank bars on left edge in the main window:
thanks BruceR
Bisto
*/
Title = EncodeColor(4)+ _DEFAULT_NAME()+";  "+EncodeColor(1) +
StrFormat("{{NAME}} - {{INTERVAL}}; {{DATE}}; O=%g, H=%g, L=%g, C=%g
(%.1f%%) 
{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) );	
/*
sym="EUR.USD-IDEALPRO-CASH"; 
fc = Foreign( sym, "C" ); 
Plot(fc,"C",1,64);
*/
Plot(C,"C",1,styleOwnScale|64);

function ZoomSync( force )
{
// All variables are made local to prevent naming collisions or side effects
//Originally guarantee 
local bv, dr, Curstdt, Curenddt, prevstdt, prevenddt, Curststr, Curendstr;
local OAB, OAD, dcount, i, OADoc, OAW, OADocWin, res;
// Get a count of the number of documents
OAB = CreateObject( "Broker.Application" );
OAD = OAB.Documents;
dcount = OAD.Count;
// Process multiple windows (documents)
res = False;

if ( dcount > 1 )
{
// Get current and last start and end DateTimes's
LastBarIndex = Status( "LastVisibleBarIndex" );
FirstBarIndex = Status( "FirstVisibleBarIndex" );
Nblankbar = Status( "LastVisibleBarIndex" ) - BarCount;
prevLastBarIndex = Nz( StaticVarGet( "_prevLastVisibleBarIndex" ) );
prevFirstBarIndex = Nz( StaticVarGet( "_prevFirstVisibleBarIndex" ) );
// Check for a new date/time range

if ( ( LastBarIndex != prevLastBarIndex OR FirstBarIndex !=
prevFirstBarIndex ) OR force )
{
// Set the new last values
StaticVarSet( "_prevLastVisibleBarIndex", Status( "LastVisibleBarIndex" ) );
StaticVarSet( "_prevFirstVisibleBarIndex", Status( "FirstVisibleBarIndex" )
);
DT = DateTime();
BI = BarIndex();
LastDateTime = LastValue( ValueWhen( LastBarIndex == BI, DT ) );
FirstDateTime = LastValue( ValueWhen( FirstBarIndex == BI, DT ) );
LastDateTimestr = DateTimeToStr( LastDateTime );
FirstDateTimestr = DateTimeToStr( FirstDateTime );
// Loop through the document collection
for ( i = 0; i < dcount; i++ )
{
// If it is not the active document -
OADoc = OAD.Item( i );
// NOTE - it doesn't hurt to sync the current window and it makes all
// windows have no blank bars on the right so they look the same
//if ( OADoc != OAB.ActiveDocument )
{
// Get the document window and zoom to range
//_TRACE( " Zoom to range document - " + i + " , " + Curststr + " - " +
Curendstr );
OADW = OADoc.Windows;
// Document window count assumed to be 1
OADocWin = OADW.Item( 0 );
OADocWin.ZoomToRange( FirstDateTimestr, LastDateTimestr );
}
}
res = True;
}
}
return res;
}

UseZoomer = ParamToggle("Use Zoomer?", "No|Yes", 0);
if (UseZoomer)
ZoomSync( False );
//================================End of
Code================================

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of reinsley
Sent: Sunday, December 06, 2009 8:43 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Maintaining cursor position between time frames



Joris,

+1

In a variation on the same theme, I made many attempts between floating 
windows displaying two different futures. I was not successful, not yet...

Could you please share your code ?

Thank in advance.

Best regards


Joris Schuller a écrit :
>  
> 
> _You want what we all want_: Expansion/contraction around the current 
> point of interest when switching time frames.  No, there is no such 
> capability.  The best way to not get lost when switching time frames is 
> clicking on your selected time, thus creating a vertical line and hunt 
> for that vertical line in the other time frame(s). Or make 3 windows, 
> set them to different time frames and use the afl?s dealing with 
> synchronized cursors, from Bruce R and modified by Bisto, who took out 
> most of the annoying zooming.  If you are interested let me know and 
> will paste them in for you.
> 
>  
> 
> *From:* amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] *On 
> Behalf Of *Anthony
> *Sent:* Wednesday, November 18, 2009 1:43 AM
> *To:* amibroker@xxxxxxxxxxxxxxx
> *Subject:* [amibroker] Maintaining cursor position between time frames
> 
>  
> 
>  
> 
> Is there a way that one can maintain your current cursor position on the 
> screen so that the chart re-organises itself around the current position 
> on the screen when switching between time frames? I am specifically 
> referring to data which may be somewhere in the middle of a historic 
> chart and which requires you to go searching for the position every time 
> you switch time frame. This can be extremely tedious especially when 
> switching between say from an hourly chart to a 5m or 1m timeframe.
> 
> Regards
> 
> Tony
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.425 / Virus Database: 270.14.72/2511 - Release Date: 
> 11/18/09 07:50:00
> 
> 



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links







------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/