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

Re: Weekly and daily analysis



PureBytes Links

Trading Reference Links

ANTHONY,
I am writing a plugin to get easily time frame price and time frame 
indicator( only ref, ma ,ema, hhv and llv)with a specific period 
(we'll can use it in intraday data), so we 'll be able to plot on a 
daily chart or on a intraday chart

tfC(period)
or tfMa(period)...

stephane

> 
> I have been pursuing this very subject for over 2 months now, I feel
> that even if we are in Daily mode setting , we should be able to 
extract
> Weekly and Monthly data. Here is an example that I believe we 
should be
> able to do , but at this time we can not.
> 
> 
> weeklypds=5;//weeks back
> weeklyPrice=C;
> 
> Weekly=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),WeeklyPrice);
> 
> value1=ref(weekly,-weeklypds);
> 
> //you would think that VALUE1 would return the weekly value of the
> close 5 weeks prior, Even though we are in Daily mode since we 
declared
> Weekly above with the formula. It does not.
> 
> As of yet, Tomasz has not responded with a workaround for this 
dilema. I
> should not need to do it in script, Amibroker should be able to do 
all
> things, we can only hope and wait for the magic.
> 
> Also, I have asked Tomasz to confirm some code concerning this very
> issue. No response.
> 
> Anthony
> 
> 
> 
> 
> 
> 
> nenapacwanfr wrote:
> 
> > Hi, Anthony,
> >
> > What you call weekly is a time frame of 5 bars ( in EOD) , not
> > exactly the weekly data.
> > So tell me if I am wrong but if you calculate a average with a 
time
> > frame of 5 and a price on a weekly mode ( dayofweek) you must have
> > somme error when the week counts < 5 days.
> >
> > >
> > > Here you are load into AA and your setting can be in Daily mode.
> > Also,
> > > if you want to check the value of the MACD(), load into AA and 
click
> >
> > > explore, then scroll back with the silder control and you will 
see
> > the
> > > values match those that are returned.
> > >
> > > Hope this helps.
> > > Anthony
> > >
> > > /*********Begin code*************/
> > > weeklyperiods=5;//1 week back=1x5=5, 2weeks=2x5=10, etc.
> > >
> > > WeeklyPrice=MACD();
> > > WeeklyMACD=ValueWhen(DayOfWeek() > Ref(
> > > DayOfWeek(),1),WeeklyPrice);//Current week.
> > >
> > > Buy=IIf(WeeklyMACD > Ref(WeeklyMACD,-weeklyperiods)AND C <
> > > Ref(C,-1),1,0);
> > > Sell=IIf(WeeklyMACD < Ref(WeeklyMACD,-weeklyperiods)AND C >
> > > Ref(C,-1),1,0);
> > > Short=0;Cover=0;
> > >
> > > Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
> > >
> > > Filter=1;
> > > AddColumn(Buy,"Buy");
> > > AddColumn(Sell,"Sell");
> > > AddColumn(WeeklyMACD,"MACDWeek");
> > > AddColumn(Ref(WeeklyMACD,-weeklyperiods),"MACDprior");
> > > /********End Code**********************/
> > >
> > > William Wong wrote:
> > >
> > > >
> > > >
> > > > Hi Anthony,
> > > >
> > > > Thanks for the reply.
> > > >
> > > > The trading rule that I am trying to test is:
> > > >
> > > > if macd of current week > macd of previous week and today 
close <
> > > > yesterday close then buy
> > > >
> > > > if macd of current week < macd of previous week and today 
close >
> > > > yesterday close then sell
> > > >
> > > > Question is:
> > > >
> > > > How do I get macd on weekly data if the setting on AA is 
daily?
> > > >
> > > > Anthony Faragasso <ajf1111@xxxx> wrote:
> > > >
> > > > William,
> > > >
> > > > I have sent several posts concerning this very issue, I 
feel
> > > > we should
> > > > be able to override any system setting with hard code. 
The
> > > > example code
> > > > below may help to explain. Load into AA, n last 
qoutation,
> > > > n=1, click
> > > > explore.
> > > >
> > > > WeeklyPds=20;//
> > > > WeeklyPrice=C;
> > > > Weekly=ValueWhen(DayOfWeek() > Ref(
> > > > DayOfWeek(),1),WeeklyPrice);
> > > >
> > > > Filter=1;
> > > > AddColumn(weekly,"Weekly");
> > > > AddColumn(Ref(weekly,-WeeklyPds),"");// This does not 
return
> > > > the Close
> > > > price 20
> > > > weeks ago while in Daily mode, it is working in Days, 
so, to
> > > > get the
> > > > Close price 20 weeks ago you should * 5;
> > > >
> > > >
> > > > williamwongys wrote:
> > > >
> > > > > I am trying to implement a daily trading rule that 
only
> > > > uses buy
> > > > > signals if the weekly trend is up and sell signals if 
the
> > > > weekly
> > > > > trend is down. How can I access the weekly data while
> > > > backtesting on
> > > > > daily data?
> > > > >
> > > > > William
> > > > >
> > > > >
> > > > > Yahoo! Groups Sponsor
> > > > ADVERTISEMENT
> > > >
> > > >
> > > > >
> > > > > Your use of Yahoo! Groups is subject to the Yahoo! 
Terms
> > > > of Service.
> > > >
> > > >
> > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms 
of
> > > > Service.
> > > >
> > > >
> > > > --------------------------------------------------------------
----
> >
> > -----
> > > > Do You Yahoo!?
> > > > Yahoo! Tax Center - online filing with TurboTax
> > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service.
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.