Fixing the first bar of the day as the first bar on Amibroker chart

LOVEENAJYOTHI

Well-Known Member
#11
Thank you for your reply. I am chart trader, candle going outside of the view can not be an option for me. However if I can shade previous day's chart may be that will be best possible solution at this point.
Or u can shade only the current Day's chart , that can be done, look deeper into the link u posted in the thread starter post.
 

TraderGYO

Well-Known Member
#12
Or u can shade only the current Day's chart , that can be done, look deeper into the link u posted in the thread starter post.
Just finished writing the code:
reference - http://www.amibroker.com/kb/2014/12/31/drawing-indicators-on-a-subset-of-visible-bars/

_SECTION_BEGIN("shadePreviousDay");
// custom function definition
function ShowLastDay( array )
{
dn = datenum();
lastDay = dn == LastValue( dn ) - 1;

return IIf( lastDay, array, Null );
}

// price plot
Plot( Close, "Close", colorDefault, styleBar );

// shaded area
colorPaleYellow = ColorBlend(colorWhite, colorYellow, 0.1);
style = styleArea | styleOwnScale | styleNoLabel;
Plot( ShowLastDay( 1 ), "", colorPaleYellow, style, 0, 1, -1, 1 );
_SECTION_END();
 

TraderGYO

Well-Known Member
#14
Nonsense. Via OLE start of day can be fixed.
Hello, I did some searching around and found http://www.amibroker.com/kb/2015/10/05/how-to-browse-charts-in-selected-date-range/
Indeed range markers does work but I am finding it difficult to place range marker at proper location by double-clicking. So, I tried the script provided on the page but it does not seem to work. Was you talking about this?


iWatchList = 0; /* you can define watch list number here */

AB = new ActiveXObject( "Broker.Application" );
Qty = AB.Stocks.Count;

for ( i = 0; i < Qty; i++ )
{
Stk = AB.Stocks( i );

if ( iWatchList < 32 )
{
if ( Stk.WatchListBits & ( 1 << iWatchList ) )
{
AB.ActiveDocument.Name = Stk.Ticker;
AW = AB.ActiveWindow;
AW.ZoomToRange( "2018-05-08", "2018-05-09" );
WScript.Sleep( 2000 ); // 2 seconds delay
}
}
else
{
if ( Stk.WatchListBits2 & ( 1 << ( iWatchList - 32 ) ) )
{
AB.ActiveDocument.Name = Stk.Ticker;
AW = AB.ActiveWindow;
AW.ZoomToRange( "2018-05-08", "2018-05-09" );
WScript.Sleep( 2000 ); // 2 seconds delay
}
}
}
 

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?