Hi,
Is there any way/hack (via registry modification?) to increase Bar Replay speed to make it more than 5 bars per second?
It's really time consuming to see 5 sec chart update 5 bars per second...
Maybe any of the beta versions has support for this?
Thank you.
Is there any way/hack (via registry modification?)
If you spend more time on the Forum/Manuals/KB and familiarize with @Tomasz the founder and dev of AB, you will release that AB is about efficiency, openness and Logic.
I doubt there is any hack for anything or Easter Eggs in AB for that matter
I don't request tick data from my vendor although its in my package, haven't tested, but
Speed (Steps/sec)
Aren't you able to speed bars up from here? That's what its meant for. What version are you using?
Hey Travick,
I am using 6.20.1. x64
It only allows to go as high as 5 steps per second. Which is too slow for my purposes.
My formula walks through the day and logs all operations into a text file. After that it's very easy to check performance and compare data with actual trades.
I do suspect that there must be some logic behind Bar Replay speed limitation, that's why I have asked if there is any "hack" to modify value at my own risk.
@Konstantin if you really need to, you can use this custom Bar Replay:
_SECTION_BEGIN( "Bar Replay v 1.1" );
// -------- by Milosz Mazurkiewicz ----------
/// @link https://forum.amibroker.com/t/how-to-increase-bar-replay-speed-above-5/7944/4?u=milosz
Version(6.21); // AmiBroker ver. 6.21 OR above required
Step = 1;
Minbars = 300;
if( Status( "action" ) == actionIndicator )
{
FVBI = Status( "FirstVisibleBarIndex" );
LVBI = Status( "LastVisibleBarIndex" );
DT = DateTime();
Bi = BarIndex();
BarsVisible = LVBI - FVBI;
XShift = Param( "XShift", 0, 0, 2560 );
YShift = Param( "YShift", 0, 0, 1600 );
SetChartOptions(0, chartShowArrows);
GfxSetBkMode( 1 );
GfxGradientRect( XShift, Yshift, XShift + 200, YShift + 100, colorWhite, ColorBlend( colorGrey40, colorWhite, 0.5 ) );
GfxSetTextColor( colorBlack );
GfxSelectFont( "Segoe UI", 9, 500 );
GfxTextOut( "Frequency (sec): ", XShift + 10, YShift + 35 );
GuiButton( "Start", 1, Xshift + 10, Yshift + 65, 75, 25, 1 );
GuiEdit( 3, Xshift + 120, Yshift + 35, 40, 20, 1 );
id = GuiGetEvent( 0, 0 ); event = GuiGetEvent( 0, 1 );
ButtonState = Nz( StaticVarGet( "ButtonState" ) );
if( id == 1 && event == 1 ) // Start/Stop button clicked
{
if( ButtonState == 0 ) StaticVarSet( "ButtonState", 1 );
else StaticVarSet( "ButtonState", 0 );
}
ButtonState = Nz( StaticVarGet( "ButtonState" ) );
if( ButtonState )
{
if( Status( "RedrawAction" ) AND LVBI+Step < BarCount)
{
FDTStr = DateTimeToStr( DT[FVBI + Step] );
LDTStr = DateTimeToStr( DT[LVBI + Step] );
AB = CreateObject( "Broker.Application" );
AW = AB.ActiveWindow;
AW.ZoomToRange( FDTStr, LDTStr );
}
GuiSetText( "Stop", 1 );
RequestTimedRefresh( StrToNum( GuiGetText( 3 ) ) );
}
else GuiSetText( "Start", 1 );
if( ButtonState == 1 ) GfxSetTextColor( colorGreen );
else GfxSetTextColor( colorRed );
GfxSelectFont( "Segoe UI", 10, 700 );
GfxTextOut( "Bar Replay v 1.1 ", XShift + 10, yShift + 5 );
}
Plot( C, "Price", colorDefault, styleCandle );
SetBarsRequired( MinBars, Step );
_SECTION_END();
Scroll your chart to the place, where you want to start and click Start/Stop.
You enter the frequency of the scrolling (refreshes) in seconds. It means, that if you enter 1, the chart will be scrolled 1 bar per second, if you enter 0.1, it will be scrolled 10 bars per second (max).
If you modify Step variable - for instance from 1 to 2, the chart will be scrolled twice as fast (for instance 20 bars per second).
It's a simplified version of my code from this thread: Link
Wow, this is gold!
Thank you!
I'll get beta version of Amirboker and give this a try.
Surprisingly I was not able to find this thread even though been looking at everything related to bar replay.
Thank you again!
Bar Replay is intended for VISUAL learning how to trade. Human perception is too slow to handle and react to more than 5 events per second. Average human reaction time is 250ms (i.e. events coming 4 times per second) see https://www.pubnub.com/blog/how-fast-is-realtime-human-perception-and-technology/
I see the point.
And yes, this means I am not using Bar Replay the way it was intended (which is not necessarily a bad thing).
However Bar Replay to me is not only a way to learn to trade but also a great way to see how trading session unwraps and how my formula reacts to it in real-time + logging the whole process in textual form.
If there is no major technical limitation to allow 10/50/100/500 bars per second playback, then I am pretty sure most users would only benefit from this increase.
Also let's not forget that there are some "extraordinary" individuals who react much faster than 250 ms )))
There is technical limitation - your computer speed. Bar replay refreshes not single chart but ALL charts. There are people that have dozens of charts open and there are people who wrote formulas that take 1000ms to execute. When you write software used by thousands you can't assume that everyone has one chart and fast formula. You need to play safe.
Otherwise you get hundreds of "not working" emails and complaints that you need to answer even though problems are user-generated. Support costs and eats more resources than development and you need to make sure you don't create potential support problems.
While I agree with @Tomasz, here is a fun fast-paced diversion:
https://www.bloomberg.com/features/2015-stock-chart-trading-game/
-Alan
But could you please add more step intervals or a custom step interval selector similar to chart interval selection. Right now bar replay's interval selector seems to be restricted to fixed intervals with 1-second being the shortest one. 1-tick step not possible?
Bar Replay plays ALL symbols at once and ALL charts at once. As such, it can't use 1-tick because 1-tick for one symbol does not work for another. Bar Replay must be TIME based (as time is the only universal unit). Bar Replay is intended to replicate REAL LIFE where TIME passes universally for ALL symbols, not one and ALL data are coming in parallel.
That was fundamental design principle.