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

[amibroker] Re: RSI(2) and AddToComposite (Code seems wrong)


  • Date: Sat, 09 Jan 2010 05:31:31 -0000
  • From: "woodshedder_blogspot" <woodshedder_blogspot@xxxxxxxxx>
  • Subject: [amibroker] Re: RSI(2) and AddToComposite (Code seems wrong)

PureBytes Links

Trading Reference Links

Glad it is working. I didn't specify, and it may be obvious to you, but in case it is not, just apply that code as an indicator and it plot for you in a pane. Run the scan and it will update the plot each night.

Wood

--- In amibroker@xxxxxxxxxxxxxxx, "wernkra" <WKRAG@xxx> wrote:
>
> Woodshedder,
> thanks for your help. 
> I think it is working now!
> Wern
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "woodshedder_blogspot" <woodshedder_blogspot@> wrote:
> >
> > Sorry Wern, I typed the code here and not in AmiB, and therefore didn't check it.
> > Here is the fix:
> > if (C[i]>1 AND AV10[i]>100000 AND RSI2[i]>90)
> > 
> > Note I added the [i] after RSI2.
> > 
> > I'm at work, and can't check it, but it should work now.
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "wernkra" <WKRAG@> wrote:
> > >
> > > Woodshedder,
> > > 
> > > thanks for your remarks and the code. Really appreciated. 
> > > There is a mistake though (and I could not fix it, unfortunately).:
> > > 
> > > <<  // Scan and Count RSI2 > 90
> > > > for (i=1; i<BarCount; i++)
> > > > {
> > > > if (C[i]>1 AND AV10[i]>100000 AND RSI2>90)
> > > >   RSI2Count[i] = RSI2Count[i] + 1;  <<<
> > > 
> > > "Error 6. Condition in IF, WHILE, FOR statements has to be Numeric or Boolean type. You can not use array here, please use [] (array subscript operator) to access array elements"
> > > 
> > > Can anyone fix this?
> > > 
> > > Thanks. 
> > > 
> > > Wern
> > > 
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "woodshedder_blogspot" <woodshedder_blogspot@> wrote:
> > > >
> > > > Wern, I think this will work for you. You'll need to use the scan feature. It is also going to compute a universe count for you as well. You can of course tweak the universe parameters any way you like.
> > > > 
> > > > Regards,
> > > > Wood
> > > > 
> > > > Buy = Sell = 0;
> > > > Universe = 0;
> > > > RSI2Count = 0;
> > > > AV10=MA(V,10);
> > > > RSI2=RSI(2);
> > > >  
> > > > // Scan and Count Universe
> > > > for (i=1; i<BarCount; i++)
> > > > {
> > > > if (C[i]>1 AND AV10[i]>100000)
> > > >   Universe[i] = Universe[i] + 1;
> > > > } 
> > > > AddToComposite (Universe, "~Universe", "X");
> > > > Plot ( Foreign("~Universe", "X"), "Universe",6,1);
> > > >  
> > > > // Scan and Count RSI2 > 90
> > > > for (i=1; i<BarCount; i++)
> > > > {
> > > > if (C[i]>1 AND AV10[i]>100000 AND RSI2>90)
> > > >   RSI2Count[i] = RSI2Count[i] + 1;
> > > > } 
> > > > AddToComposite (RSI2Count, "~RSI2Count", "X");
> > > > Plot ( Foreign("~RSI2Count", "X"), "RSI2Count",6,1);
> > > > 
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "wernkra" <WKRAG@> wrote:
> > > > >
> > > > > Hi there,
> > > > > 
> > > > > is there a way to count the number of stocks which are at a certain RSI(2) threshold?
> > > > > I'd like to plot the number of stocks with RSI(2) > 90.
> > > > > 
> > > > > I guess that could be done with AddtoComposite.
> > > > > 
> > > > > How would I do that?
> > > > > 
> > > > > Thanks.
> > > > > 
> > > > > Wern
> > > > >
> > > >
> > >
> >
>




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

**** 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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/