PureBytes Links
Trading Reference Links
|
Perhaps there is something in this toolbox-snippet that you can use:
// RT Time references
StartOfDay = DateNum() != Ref(DateNum(),-1);
EndOfDay = (DateNum() != Ref(DateNum(),1)) OR (BarIndex() == (BarCount-1));
DaysOpenBar=Cross(TimeNum(),093000);
DaysCloseBar=Cross(TimeNum(),160000);
PreHours = TimeNum() < 093000;
AfterHours = TimeNum() > 160000;
NormalHours = NOT (PreHours OR AfterHours);
// Significant Prices
DaysFirstPrice = ValueWhen(StartOfDay, Open);
DaysOpenPrice = TimeFrameGetPrice("O",inDaily);
DaysLastPrice = ValueWhen(EndOfDay, Close);
DaysClosePrice = TimeFrameGetPrice("C",inDaily);
PreHourChange = DaysOpenPrice - DaysFirstPrice;
AfterHoursChange = DaysLastPrice - DaysClosePrice;
DayChange = DaysClosePrice - DaysOpenPrice;
/*
Plot(C,"C",1,128);
Plot(DaysFirstPrice,"DaysFirstPrice",5,1);
Plot(DaysLastPrice ,"DaysLastPrice ",4,1);
Plot(DaysOpenPrice ,"DaysOpenPrice ",6,1);
Plot(DaysClosePrice ,"DaysClosePrice ",7,1);
Plot(EndOfDay,"",4,2|styleOwnScale,0,1);
Plot(StartOfDay,"",5,2|styleOwnScale,0,1);
Plot(DaysOpenBar,"",6,2|styleOwnScale,0,1);
Plot(DaysCloseBar,"",7,2|styleOwnScale,0,1);
Plot(PreHours ,"",6,2|styleOwnScale|styleArea,0,1);
Plot(NormalHours ,"",7,2|styleOwnScale|styleArea,0,1);
Plot(AfterHours ,"",9,2|styleOwnScale|styleArea,0,1);
-----Original Message-----
From: ed [mailto:ed2000nl@xxxxxxx]
Sent: Thursday, May 20, 2004 7:42 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] last bar in day, close price
Importance: High
Herman,
I don't think so. I want to know that I am seeing the last bar of the day to
be able to enter the "if statement". Only if the price stays within certain
limits the entire day then I want to enter the "if statement". Now I look
one day ahead to find this bar:
AND phase_arr[ i ] == 1 AND phase_arr[ i + 1] != 1
So I need to know that I see the last "hour" or "minute" bar of that day
before I want to enter the "if statement". Here the "if statement" I use
currently that uses a future bar:
// stay in area 1 and cover position at the close
if (L[ i ] > B1[ i ] AND H[ i ] < HBOP[ i ] AND phase_arr[ i ] == 1
AND phase_arr[ i + 1] != 1) {
// cover at close
Cover[ i ] = 1;
CoverPrice[ i ] = C[ i ];
reaction_position_short = 0;
} else
So I like the code to look like without using a future bar:
// stay in area 1 and cover position at the close
if (L[ i ] > B1[ i ] AND H[ i ] < HBOP[ i ] AND
ThisIsTheLastBarOfThisDay) {
// cover at close
Cover[ i ] = 1;
CoverPrice[ i ] = C[ i ];
reaction_position_short = 0;
} else
regards,
Ed
----- Original Message -----
From: Herman van den Bergen
To: amibroker@xxxxxxxxxxxxxxx
Sent: Thursday, May 20, 2004 1:23 PM
Subject: RE: [amibroker] last bar in day, close price
can't you use
DaysClosePrice = TimeFrameGetPrice("C",inDaily);
herman
-----Original Message-----
From: ed [mailto:ed2000nl@xxxxxxx]
Sent: Thursday, May 20, 2004 6:58 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] last bar in day, close price
hello,
I want to be able find the close price of the last bar inside a day using
intraday data.
The problem is that if the price stays within a certain range during the day
the position is closed at the close price. However I need to know what the
last bar is of that day otherwise it would close out the position at the
first intraday bar.
The condition therefor becomes:
1) Price is within the range.
2) AND this is the last intraday bar of this day.
Currently I look one bar ahead to find that it is the last bar of this day
but this is not what I want,
thanks for help,
rgds, Ed
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|