I still am looking
for some words about how to identify a given bar in Intraday mode. I would
like to enter a "Buy Date & Time" and have a trailing stop plotted from this
point. I posted my full code, in Daily mode, in another message. I
am trying to get the same functionality in Intraday mode.
I created the
following code to help me understand things like TimeNum(), DateTime(),
etc. I have seen that BarIndex() changes depending on the interval
selected. I also notice that the quality of the data in the intraday
database is important. I use QuoteTracker, set for 1 minute data
gathering. Sometimes it misses bars (esp if the application isn't running
at the start of the market). So the number of bars reported from BarIndex
in 30 min mode is not double the number of bars reported in hourly
mode.
Here is the test
code I wrote.
Plot
(C,"Close",colorRed,styleCandle);Ix =
Interval(0)/60;T =
TimeNum();DT =
DateTime();DN =
DateNum();BI =
BarIndex();E3 =
EMA(C,3);e21 =
EMA(C,21);Up =
Cross(E3,E21);Dn =
Cross(E21,E3);Plot
(E3,"E3 -- Interval = " + WriteVal(Ix,1.0) + " Min",colorBlue,styleLine);Plot
(E21,"E21 -- BarIndex = " + WriteVal(BarIndex(),1.0),colorRed,styleLine);//
Title = WriteVal( DateTimeConvert( 2, BuyDate ), formatDateTime );Plot
(Null,"TimeNum = " + WriteVal(DT,formatDateTime),colorWhite,styleLine);Plot
(Null,"\nDateNum() = " + WriteVal(DT,1.0) + "TimeNum = " + WriteVal(t,1.0),colorBlue,styleLine);PlotShapes
(Up*shapeUpArrow,colorGreen);PlotShapes
(Dn*shapeDownArrow,colorRed);BuyDate =
442;//1061005;On = BI == Buydate;
PlotShapes
(On*shapeUpTriangle,colorAqua);Can someone suggest
a way to enter the BuyDate easily. Right now I am thinking to display the
bar number, then write in the code, like above, the Bar Number for the
BuyDateTime.
Is there a number
that represents the combination of the Date and Time? If you plot the
above code, the number showing up for DateNum is an impossibly long and non
obvious number.
Any help out there
on this issue???
Ken
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
| Software support | Small business finance | Business finance online |
| Business finance training | Business finance course |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
