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

[amibroker] Re: get atr value at tradetime



PureBytes Links

Trading Reference Links

tried another variation. for some reason, i cannot get the timenum correctly as when i do a trace on tn it always returns no value.
tradedatew=1090807;
tradetime=145346;
tn1=TimeNum();
tn=tn1<=tradetime AND (tn1 + Interval())>=tradetime;
_TRACE(NumToStr(tn1));
dt=DateNum()==tradedatew;
at=ATR(14);
a=ValueWhen(tn AND dt ,at,1);
_TRACE("ATR" + NumToStr(a));
a=ValueWhen( tradedatew==DateNum() AND TimeNum()<=tradetime ,DateNum(),1);
_TRACE("Date " + NumToStr(a));
a=ValueWhen(tradedatew==DateNum() AND TimeNum()<=tradetime ,TimeNum(),1);
_TRACE("Time " + NumToStr(a));



--- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <murthysuresh@xxx> wrote:
>
> hello
> i am trying to print the atr value at print time. but for somereason, i am getting the time out of sync
> tradedatew=1090807;
> tradetime=45346;
> a=ValueWhen(tradedatew==DateNum() AND TimeNum()<=tradetime   ,ATR(14),1);
> _TRACE("ATR" + NumToStr(a));
> a=ValueWhen( tradedatew==DateNum() AND TimeNum()<=tradetime   ,DateNum(),1);
> _TRACE("Date " + NumToStr(a));
> a=ValueWhen(tradedatew==DateNum() AND TimeNum()<=tradetime   ,TimeNum(),1);
> _TRACE("Time " + NumToStr(a));
> 
> my trace keeps printing 43000.000 as time. so i am making a mistake somewhere. my database is running on 1 minute bars.
> 
>   ATR   0.031	___COMMENTARY___	21	27	19:26:03.06
> Date 1090807.000	___COMMENTARY___	23	29	19:26:03.07
> Time 45300.000	___COMMENTARY___	25	29	19:26:03.09
> CLICKED ON    0.000	Formulas\Custom\_Price.afl	1122	50	19:26:03.26
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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/