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

RE: [amibroker] Error 29 on NYSE and OTC but not on AMEX?



PureBytes Links

Trading Reference Links

why not just initialize buy, etc. at top of code?
 
d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Steve Dugas
Sent: Saturday, July 16, 2005 12:03 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Error 29 on NYSE and OTC but not on AMEX?

The error msg is refering to the Buy that you are using as an arg in the
Exrem Function. Since you assign a value to this inside your for loop, it
appears that your loop is not executing for certain stocks. My guess would
be that your list contains tickers with only 3 or 4 data bars. Try removing
these from your list.

Steve

----- Original Message -----
From: "stevemajors" <stevemajors@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, July 16, 2005 11:15 AM
Subject: [amibroker] Error 29 on NYSE and OTC but not on AMEX?


>I get a message 'Error 29 variable 'buy' used without being
> initilized' when running a backtest on the NYSE or OTC list but not
> when using the AMEX list.
>
> The lines highlighted are:
>
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
>
> I have the following code:
>
> PositionSize = 10000;
>
> PB_per = 5;
> PBbot = HHV(Ref(High,-1) , 1);
>
> PBbot_slope = LinRegSlope( Ref(Low,-1), PB_per);
> for (bar = PB_per-1; bar < BarCount-1; bar++)
> {
>  for (loop = 0; loop < PB_per-1 ; loop++)
>  {
>    PBbot = Min(PBbot, LLV(Ref(Low,-1),4) + (PBbot_slope*loop));
>  }
> }
>
> for (bar = PB_per-1; bar < BarCount-1; bar++)
> {
>    BuyPrice = 0.962 * PBbot ;
> Buy = Low < BuyPrice ;
>   Sell = Open;
> }
>
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
>
>
> Any help would be much appreciated
>
>
>
>
>
>
>
> 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 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 other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS