Quick way to seek to a specified Date?

The reason to do this, is to debug visally,
I always need to stare on over 100 thsands bars
to seek to a specified Date
(actually this behavior cost time and eyes) to find some
PlotText or PlotShapes (or manually drawing studies or comments).

Below is my imagination for this function:

  1. Like Microsoft Word, provides Edit > go to page, but select a date.
  2. Let user do it with three steps:
    step1: user use mouse to switch to daily-timeframe manually.
    (now AmiBroker remember this date automatically)
    step2: user use mouse to seek to a specified date,
    step3: user use mouse to switch back to current-timeframe manually again.

Is there a quick way to seek to a specified date?
(or please consider to provide this function on future versions)

Thank you very much :slight_smile: !

1 Like

AFL Function Reference enlist links to all the functions.

  1. Using DateTimeConvert(), you'll be able to play around with any format of Date and Time;
  2. Using GetCursorXPosition() / GetCursorYPosition() and by storing its value to a StaticVar, you'll be able to capture information of a bar from the mouse pointer.

Try DateTime() and Lookup().

1 Like

Thank you :slight_smile:!

What I need is like Microsoft Word go to a specified page.
(I want to go to a specified date on chart window)

If let you write a C# or VB program,
what would you do when your homework
is to specified a date then go to the date to see
the first bar of your selected date (ex. 2019/11/06)
to be shown on the left-end of your chart window?

Maybe you would like to use a 'DateTimePicker'
as your date selector object, so after you choose a date
with this 'DateTimePicker'...

Such a feature already exist in form of bar-replay!

Otherwise programmatically you can use OLE Object like ZoomToRange. But OLE objects needs to be handled very carefully!

@alexlin You can use a code provided by @fxshrat :

BTW you can use either ParamDate() or recently introduced GuiDateTime() to select your date.

https://www.amibroker.com/guide/afl/guidatetime.html
https://www.amibroker.com/guide/h_gui.html

1 Like

Thank you @Milosz :slight_smile:,
code provided by @fxshrat is good when not much bars on you chart.

it execute the SetBarsRequired( -2, -2 );
and call the OLE, so let my chart become very very slow
(I've got over 100 thousands bars)

There is 'Go to a date' similar function
already works for a very long time in AmiBroker,
that is 'Show current trade arrows' for your trade list.
show_current_trade_arrow

I think that developer is too busy
to migrate this function to the chart window,
'Go to a date', for example 'Go to 2019/11/07',
such function provides much more convenient for user
to go to a specified date among big amount of bars.

1 Like