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

[amibroker] Re: Reference the market open



PureBytes Links

Trading Reference Links

I'm with you James... but assuming you have defined all the relvant
open/close times for each symbol in each of the various groupings,
then I still think the code below will work.

By definition, if you are looking at the 'day session' only (in
exchange times) then each new session (both the start of the session
and the end of the session) will result in a new day... So,

Session_Cross = IIf(BarsSince( Day() != Ref(Day(), -1)),True,False) ;

should spot the change in day... whatever the session times have been
defined as.



--- In amibroker@xxxxxxxxxxxxxxx, James <jamesmemphis@xxx> wrote:
>
> Thanks for the reply. Maybe I didn't make myself clear. The code
below is from the Fisher ACD system that came off this list a few
months back. It uses the code:
> MarketOpen = 83000; 
> MarketClose = 151500; 
> to do two things. 1. It finds the high and the low from the previous
day between these hours to calculate daily pivot points and 2. it uses
the opening time to calculate and opening range high and low for the
current day. The problem arises when you change symbols from ES, which
opens at 8:30 and closes at 15:15 to Crude Oil or Bonds or Cotton
which all open and close at different times. In order to use the ACD
software as written, you would have to edit the code or change these
two variables to parameters and change them with each symbol. 
> However, since you can set up groups that have there own intraday
settings, then it would work fine if you could reference the groups
intraday "Day session" start time and end time. With every new symbol
selected the MarketOpen and MarketClose would be adjusted to the
proper time. the only way I know to reference different open and close
times in the same pane is to reference the Day Session start and end
times for the group, but I am open to any and all suggestions.
> James
> 
> 
> 
> ----- Original Message ----
> From: sidhartha70 <sidhartha70@xxx>
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Tuesday, June 10, 2008 5:36:27 PM
> Subject: [amibroker] Re: Reference the market open
> 
> 
> James,
> 
> If the opening time is a different day, you could use something like,
> 
> Session_Cross = IIf(BarsSince( Day() != Ref(Day(), -1)),True,False) ;
> 
> Session_Cross will be True at the cross over points.
> 
> If the cross over points are not different days then you'll have to
> use another technique.
> 
> and of course just check for 
> --- In amibroker@xxxxxxxxx ps.com, James <jamesmemphis@ ...> wrote:
> >
> > Is there a way to reference the opening time of a group if the group
> has it's own intraday settings?
> > I would like to reference the open and close and replace this code:
> > // Defines market hours 
> > MarketOpen = 83000; 
> > MarketClose = 151500; 
> > MarketHours = deFlagTimeRange( MarketOpen, MarketClose) ; 
> > FirstBarOfDay = deFlagFirstBarOfDay (MarketOpen) ; 
> > LastBarOfDay = deFlagLastBarOfDay( MarketClose) ; 
> > so that I do not have to change the market open when I change
> commodities. Any other approach welcomed.
> > Thanks,
> > James
> >
>



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

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/