Hi TJ, That's what I had originally and it didn't work. In this particular code, I was just trying anything.
JH --- In [email protected], "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > You need to do this the other way round. > FIRST SetForeign > and THEN any TimeFrame***() functions. > > > Best regards, > Tomasz Janeczko > amibroker.com > ----- Original Message ----- > From: "jeffro861" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Friday, October 19, 2007 1:07 AM > Subject: [amibroker] Re: More problems > > > > Hi Graham, > > > > I took all the time functions out except for timeframeexpand() in the > > plots, and the resulting indicators were the same as the following > > code. As you can see I put timeframerestore() before > > restorepricearrays()-- I think that's what you meant. > > > > In any case,the code with and without the timeframeset produced the > > same indicator (they visually were identical) except for the values > > in time. > > > > // Weekly Relative strength > > _SECTION_BEGIN("Weekly Relative Strength of Sector vs. SP-500"); > > > > TimeFrameSet(inWeekly); > > SetBarsRequired(100000,100000); > > > > SetForeign(GetBaseIndex > > ()); //OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO > > marketrs1=RelStrength("sp-500",0); > > lmarketup1=EMA(marketrs1,50); > > smarketup1=EMA(marketrs1,10); > > > > cry0rs=RelStrength("cry0"); > > lcommup=EMA(cry0rs,50); > > scommup=EMA(cry0rs,10); > > TimeFrameRestore(); > > RestorePriceArrays(); > > > > marketrs=TimeFrameExpand(MArketrs1,inWeekly); > > Lmarketup=TimeFrameExpand(Lmarketup1,inWeekly); > > smarketup=TimeFrameExpand(sMArketup1,inWeekly); > > > > Plot(MArketrs,"Sector Relative Strength vs. Sp- > > 500",colorGreen,styleLine); > > Plot(Lmarketup,"EMA 50",colorRed,styleThick); > > Plot(smarketup,"EMA 10",colorBlue,styleThick); > > > > _SECTION_END > > ();//00000000000000000000000000000000000000000000000000000000000000000 > > 000 > > > > > > --- In [email protected], Graham <kavemanperth@> wrote: > >> > >> you do need to add timeframerestore(); at the end of the compressed > > section > >> > >> > >> -- > >> Cheers > >> Graham Kav > >> AFL Writing Service > >> http://www.aflwriting.com > >> > >> > >> On 19/10/2007, jeffro861 <jeffro861@> wrote: > >> > Okay I added setbarsrequired and now the values are the same, but > > not > >> > it's not matching up to the relstrength() function. > >> > > >> > > >> > --- In [email protected], "jeffro861" <jeffro861@> wrote: > >> > > > >> > > I changed the code to the following and now I have another > > problem. > >> > > When I do an exploration for the values of the plotted lines, my > >> > values > >> > > are different than my the indicators. I also noticed that when > > I > >> > > "apply" the indicator to the chart, the values are the same as > > the > >> > > exploration, but when I click on the chart or refresh it, then > > the > >> > > indicator changes again. Any suggestions? TIA > >> > > // Weekly Relative strength > >> > > > >> > > _SECTION_BEGIN("Weekly Relative Strength of Sector vs. SP- 500"); > >> > > > >> > > SetForeign(GetBaseIndex()); > >> > > >> //OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O > >> > OOOO\ > >> > > OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO > >> > > > >> > > TimeFrameSet(inWeekly); > >> > > > >> > > marketrs1=RelStrength("sp-500"); > >> > > > >> > > lmarketup1=EMA(marketrs1,50); > >> > > > >> > > smarketup1=EMA(marketrs1,10); > >> > > > >> > > cry0rs=RelStrength("cry0"); > >> > > > >> > > lcommup=EMA(cry0rs,50); > >> > > > >> > > scommup=EMA(cry0rs,10); > >> > > > >> > > RestorePriceArrays(); > >> > > > >> > > marketrs=TimeFrameExpand(MArketrs1,inWeekly); > >> > > > >> > > Lmarketup=TimeFrameExpand(Lmarketup1,inWeekly); > >> > > > >> > > smarketup=TimeFrameExpand(sMArketup1,inWeekly); > >> > > > >> > > Plot(MArketrs,"Sector Relative Strength vs. > >> > > Sp-500",colorGreen,styleLine); > >> > > > >> > > Plot(Lmarketup,"EMA 50",colorRed,styleThick); > >> > > > >> > > Plot(smarketup,"EMA 10",colorBlue,styleThick); > >> > > > >> > > _SECTION_END > >> > ();//0000000000000000000000000000000000000000000000000000000\ > >> > > 0000000000000 > >> > > > >> > > --- In [email protected], "jeffro861" <jeffro861@> > > wrote: > >> > > > > >> > > > > >> > > > I'm having problems with the following code. It's supposed to > >> > chart > >> > > the > >> > > > relative strength of the base index, compared to the sp- 500. > > Even > >> > > > though the baseindex that I assigned to the subindustries are > > the > >> > > same, > >> > > > by RS line is different. I'm using tc2000 data and the > > problematic > >> > > > subindustry groups are MG711 and MG716. Could somebody please > >> > help? > >> > > > > >> > > > TIA > >> > > > > >> > > > > >> > > > > >> > > > // Weekly Relative strength > >> > > > > >> > > > _SECTION_BEGIN("Weekly Relative Strength of Sector vs. SP- > > 500"); > >> > > > > >> > > > sector=GetBaseIndex(); > >> > > > > >> > > > SetForeign(sector); > >> > > > > >> > > >> //OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O > >> > OOOO\ > >> > > \ > >> > > > OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO > >> > > > > >> > > > //define trend of overall market > >> > > > > >> > > > TimeFrameSet(inWeekly); > >> > > > > >> > > > marketrs1=RelStrength("sp-500"); > >> > > > > >> > > > lmarketup1=EMA(marketrs1,50); > >> > > > > >> > > > smarketup1=EMA(marketrs1,10); > >> > > > > >> > > > cry0rs=RelStrength("cry0"); > >> > > > > >> > > > lcommup=EMA(cry0rs,50); > >> > > > > >> > > > scommup=EMA(cry0rs,10); > >> > > > > >> > > > RestorePriceArrays(); > >> > > > > >> > > > Plot(MArketrs1,"Sector Relative Strength vs. > >> > > > Sp-500",colorGreen,styleLine); > >> > > > > >> > > > Plot(Lmarketup1,"EMA 40",colorRed,styleThick); > >> > > > > >> > > > Plot(smarketup1,"EMA 10",colorBlue,styleThick); > >> > > > > >> > > > _SECTION_END(); > >> > > > > >> > > > >> > > >> > > >> > > >> > > >> > 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > >> > http://www.amibroker.com/devlog/ > >> > > >> > For other support material please check also: > >> > http://www.amibroker.com/support.html > >> > > >> > Yahoo! Groups Links > >> > > >> > > >> > > >> > > >> > > > > > > > > > > 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > http://www.amibroker.com/devlog/ > > > > For other support material please check also: > > http://www.amibroker.com/support.html > > > > Yahoo! Groups Links > > > > > > > > > > >
