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

Re: [amibroker] Re: AmiBroker 4.53.0 BETA released



PureBytes Links

Trading Reference Links

Dimitris,

Excellent. And thanks.  The applications of this idea of screening 
any array, for any condition, and generating new array based on it 
are important.

Regards,
- Salil V Gangal 



--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> The question is more general and has a lot of applications.
> Example 1
> To create an array with the historical Close values when StochD() 
> crosses 50.
> 
> Cond=Cross(StochD(),50);
> Ctue=ValueWhen(Cond,C);
> Plot(Ctue,"Ctue",1,1);
> num=LastValue(Cum(Cond));L1=LastValue(Cum(1))-1;
> j=L1-num;g=0;
> for(i=0;i<BarCount;i++)
> {
> if(Cond[i]==1)
> {
> g[j]=Ctue[i];j=j+1;
> }
> }
> Plot(g,"g",2,2);
> 
> The elements were placed at the end.
> Example 2
> To create an array with the historical RSI() values when MACD() 
> crosses its Signal().
> 
> Cond=Cross(MACD(),Signal());
> Ct=ValueWhen(Cond,RSI());
> Plot(Ct,"Ct",1,1);
> num=LastValue(Cum(Cond));
> j=0;g=0;
> for(i=0;i<BarCount;i++)
> {
> if(Cond[i]==1)
> {
> g[j]=Ct[i];j=j+1;
> }
> }
> Plot(g,"g",2,2);
> Filter=Cond;
> AddColumn(Ct,"Ct");
> 
> The elements were placed in the beginning.
> 
> In other words, as you see from the last example, we actually 
create 
> an array with the results of the exploration 
> Filter=Cond;
> It is another way to save the results of an exploration for any 
> further use.
> Since these results form a new array, we may also apply any 
> transformation, MA(g,10), RSIa(g,5) etc.
> It is interesting.
> Dimitris Tsokakis
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
<TSOKAKIS@xxxx> 
> wrote:
> > Salil,
> > Let the new array be g. In IB you may have
> > 
> > Cond=DayOfWeek()==2;
> > Ctue=ValueWhen(Cond,C);
> > Plot(Ctue,"Ctue",1,1);
> > j=0;g=0;
> > for(i=0;i<BarCount;i++)
> > {
> > if(Cond[i]==1)
> > {
> > g[j]=Ctue[i];j=j+1;
> > }
> > }
> > Plot(g,"g",2,2);
> > 
> > The array g will have the Tuesdays values for the first LastValue
> (Cum
> > (Cond)) elements. The rest are filled with zeros[or any other 
> value].
> > If you want to move g at the end, then it should begin from the 
> > (L1-num) th element with
> > 
> > Cond=DayOfWeek()==2;
> > Ctue=ValueWhen(Cond,C);
> > Plot(Ctue,"Ctue",1,1);
> > num=LastValue(Cum(Cond));L1=LastValue(Cum(1))-1;
> > j=L1-num;g=0;
> > for(i=0;i<BarCount;i++)
> > {
> > if(Cond[i]==1)
> > {
> > g[j]=Ctue[i];j=j+1;
> > }
> > }
> > Plot(g,"g",2,2);
> > 
> > Dimitris Tsokakis
> > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> <TSOKAKIS@xxxx> 
> > wrote:
> > > Salil,
> > > cond=Dayofweek()==2;
> > > num=lastvalue(cum(cond));
> > > will give the length of this new array.
> > > Dimitris Tsokakis
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Salil V Gangal" 
> > > <salil_gangal@xxxx> wrote:
> > > > Friends,
> > > > 
> > > > I have a data-series, say Nasdaq Composite closing values 
> (^IXIC) 
> > > in 
> > > > AmiBroker, then is there a way I can create an array based on 
> > this 
> > > > data-series of Nasdaq, which has in it the closing values of 
> only 
> > > > Tuesday's using AFL, within Indicator Builder ?  If Tuesday's 
> > data 
> > > is 
> > > > not present, then next day's data is to be taken instead.
> > > > 
> > > > Regards,
> > > > - Salil V Gangal



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/