Different market start timings

amitrandive

Well-Known Member
#1
Dear All

Is it possible to have different databases in Amibroker for having different market start and end timings.

Here the first 5 min bar shoud start at the market start timings.

Database Equity
Equity market
Market start : 9:15 Market End : 15:30

Database Commodity
Commodity Market
Market start1 : 18:15 Market End1 : 23:30
Market start2 : 10:15 Market End2 : 18:14

Database Currency
Currency Market
Market start : 09:00 Market End : 17:00

Thanks
Amit
 

trash

Well-Known Member
#2
You don't need different data bases to do that!

You can leave all markets in one data base and then you move the symbols of each market to a separate GROUP. Then you go to Symbol>Categories>Group and check "Group uses own intra-day settings" and set according market times.

But you can have separate data bases for each market also and run multiple instances of AmiBroker if you wanna view all markets at the same time. To set market times in each DB just go to File>Database settings>Intraday settings.
 

amitrandive

Well-Known Member
#3
You don't need different data bases to do that!

You can leave all markets in one data base and then you move the symbols of each market to a separate GROUP. Then you go to Symbol>Categories>Group and check "Group uses own intra-day settings" and set according market times.

But you can have separate data bases for each market also and run multiple instances of AmiBroker if you wanna view all markets at the same time. To set market times in each DB just go to File>Database settings>Intraday settings.
Thanks Trash !!!!
 

manojborle

Well-Known Member
#4
How can we move a symbol to a Group ?
 

trash

Well-Known Member
#5
How can we move a symbol to a Group ?

There are multiple ways to do that.
Either go to Symbol>Organize assignments
Or making symbol list(s) and using ASCII import. Via Ascii you can assign a group to each symbol or to a group of symbols also.
Or using CategoryAddSymbol function

For example using Exploration

Code:
MarketNumber = 0;
GroupNumber = 1;

if ( Status( "action" ) == actionExplore )
{
    CategoryAddSymbol( "", categoryGroup, GroupNumber );
    groupname = CategoryGetName(categoryGroup, GroupNumber );

    AddTextColumn( "Symbol added to Group " + GroupNumber, "Status of Group '" + groupname + "'", 1, colorLightYellow, colorDarkGreen, 150 );
    Filter = Status( "lastbarinrange" ) and MarketID() == MarketNumber;
}

SetOption( "RefreshWhenCompleted", True );

If using symbols of a Watchlist and moving all of them to a group at once

Code:
WatchlistNumber = 0;
GroupNumber = 1;

if ( Status( "action" ) == actionExplore )
{
    CategoryAddSymbol( "", categoryGroup, GroupNumber );
    groupname = CategoryGetName(categoryGroup, GroupNumber );

    AddTextColumn( "Symbol added to Group " + GroupNumber, "Status of Group '" + groupname + "'", 1, colorLightYellow, colorDarkGreen, 150 );
    Filter = Status( "lastbarinrange" ) AND InWatchlist( WatchlistNumber );
}

SetOption( "RefreshWhenCompleted", True );
etc.....
 
Last edited:

trash

Well-Known Member
#6
You can also use Names for Market/Watchlist/Group

Here I use name for market

Code:
MarketName = "NYSE"; // name of market in your Symbol tree
GroupNumber = 0;

if ( Status( "action" ) == actionExplore )
{
    CategoryAddSymbol( "", categoryGroup, GroupNumber );
    groupname = CategoryGetName(categoryGroup, GroupNumber );

    AddTextColumn( "Symbol added to Group " + GroupNumber, "Status of Group '" + groupname + "'", 1, colorLightYellow, colorDarkGreen, 150 );
    Filter = Status( "lastbarinrange" ) AND MarketID(1) == MarketName;
}

SetOption( "RefreshWhenCompleted", True );
for Watchlists it would be function InWatchlistName("...")
 

Similar threads