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

Re: [amibroker] Timeframe question



PureBytes Links

Trading Reference Links

Plot the data you want and see what is happening, something like this
plot(c,"close",colorgrey50,stylecandle)
plot( timeframeexpand( timeframecompress(c, indaily, compresslast), indaily, expandlast ), "daily", colorblue, stylestaircase);
 
 
What country are you in? Is your data in your local time or US EST time and if so does the time of the data straddle your midnight? eg I am in Australia and ASX market time 10am-4pm. My data comes as US times which atm is exchange time 8pm to 2am, so it straddles my exchange midnight. AB timeframe indaily unfortunately works against the database times, ie midnight to midnight, so it shows from 2pm to 2pm on my charts and scans...have reported to TJ already
 
best way to overcome this would be to use valuewhen until the timeframes get fixed
 
YesterdayClose = valuewhen( datenum()!=ref(datenum(),1), C );

 
On 10/17/05, Nikku <nikku@xxxxxxxx> wrote:
Hi Graham
 
Thanks a lot for taking the time to reply. I went to File--Database Settings--Intraday and saw that my trading day is defined as 09:30 until 17:00. Therefore all data falls between these times. Filtering is set to 'Show 24 hours trading'. I thought that since I only have the day session in my data, I should switch this to 'Show day session only', but when I tried choosing that option, my chart just turned into a bunch of flat lines instead of candles.
 
For Daily Time Compression uses I am using 'Exchange Time'.
 
I am assuming that the field 'Base Time Interval' which is available under Database settings is not relevant since it was fixed when I created the database.
 
Unfortunately, the indicator I am trying to write, which now looks very simple, like this
 
cond=TimeFrameGetPrice("C",inDaily,-1);

Cond1=C>Cond;

Plot

(Cond1,"",43,4, 512);

is not providing me with what I need. The last bar of the day, the one that is sometimes 4:02, sometimes 4:05 etc etc is not the bar which is providing the 'closing price' variable which I need, the price above which I want a signal on the next trading day. I am trying to figure out exactly what prices are being used but it is not clear to me at this time.

I have a feeling that this is a problem with the Database settings but I don't know how to fix it. I am trying to use the help to figure this out right now, so I might get lucky tonight - any more comments are appreciated.

Nikku

----- Original Message -----
From: Graham
Sent: Sunday, October 16, 2005 6:02 PM
Subject: Re: [amibroker] Timeframe question

 
Nikku
It reads the times as per your settings in File-Databse Settings - Intraday for the market hours
 
To get yesterday's close you can use timeframegetprice with shift=-1

 
On 10/17/05, Nikku <nikku@xxxxxxxx> wrote:
Hi everyone
 
Those who know me know that I am no programmer, but I'm willing to try before asking. Here is what I am facing today.
 
I have NAZ 100 data from 3/3/04 to 11/2/2004, 1 minute bars. I wanted to try to write an indicator which would determine yesterdays close and then give a signal when the closing price of the current 1 minute bar exceeded yesterdays close. I came up with this. Remember, the chart and the data set are 1 minute intervals.
 
Cond=TimeFrameSet(inDaily);

Cond1=Ref(C,0);

Cond2=Ref(O,0);

TimeFrameRestore();

Cond3=C>TimeFrameExpand(Cond1,inDaily);

Plot(Cond3,"",43,4,512);

(By the way, I initially tried Ref(c,-1)  to reference yesterdays close but for some reason, the formula then looked at the close 2 days ago).

So lo and behold - this thing seems to be working!! I can observe the closing price from the day before and then I see that when the current day's 1 minute bar closes above that, I get a signal. However...

My data is such that at the end of the trading day, the last bar is sometimes given at 4:01 p.m., sometimes at 4:03 p.m., sometimes they even go on until 4:08 p.m. The formula I have created, however, seems to be assuming that the price at 3:59:00 p.m. is the closing price, because sometimes, if the 4:00:00 bar closes higher than the 3:59:00 bar, my indicator often goes off.   Even if this doesn't happen, I can see that the signals I am getting are related to the yesterdays 3:59:00 bar and not the very last bar in yesterdays data. The price from 3:59:00 is the one that is the formula is saying is the 'close'. Now, sometimes the 3:59:00 price is close enough to the actual final bar of the day that this doesn't make much difference, but sometimes it isn't. This is the first problem I am having.

The second is this  - Right now, the software seems to be rounding off to the nearest whole number when determining the closing price. I have figured this out by drawing a horizontal line through the closing price at the 'last' bar of the day before (actually the 3:59:00 bar!!) and then seeing EXACTLY when the trigger is given the next day, if of course one is given.

Any help is appreciated.

Nik



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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS







--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm

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





YAHOO! GROUPS LINKS







--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm

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





YAHOO! GROUPS LINKS