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

Re: [amibroker] Re: Backtesting Market Timing Signals



PureBytes Links

Trading Reference Links


Hello,

1. You should contact the author of the formula. I am not the autor.
2. I was just mentioning the fact that backslash should be written as \\
(I did not check the formula for other errors - various people send formulas
here and you should contact the original author because I am not responsible
for other people's mistakes )
3. "Array subscript has to be a number" error means that the author of the
formula made the mistake (used a string or array as subscript)
4. printf output is written to:
- commentary window
- interpretation window.

Consult Users guide for more details


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "bilbo0211" <bilbod@xxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, March 07, 2005 4:09 PM
Subject: [amibroker] Re: Backtesting Market Timing Signals


> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
> wrote:
> Note: I still cannot figure out how to view the printf output?
> 
> I changed the incorrect line and now get this error
> ---
> Line 59, Column 14:
> }
> 
> Buy=Sell=Short=Cover=0;
> 
> getSignalDates("d:\\my programs\\amibroker\\fssignals");
> -------------------------------------------------------^
> 
> Error 6.
> Array subscript has to be a number
> ---
> 
> Bill
> 
>> Of course not. Single backslash in AFL must be written as \\
>> 
>> Example:
>> 
>> "C:\\Program Files\\AmiBroker\\Formulas\\MyFormula.afl"
>> 
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>> ----- Original Message ----- 
>> From: "Graham" <kavemanperth@xxxx>
>> To: <amibroker@xxxxxxxxxxxxxxx>
>> Sent: Monday, March 07, 2005 9:18 AM
>> Subject: Re: [amibroker] Backtesting Market Timing Signals
>> 
>> 
>> > 
>> > Is this lne correct?
>> > ( "d:/my\ programs/amibroker\fssignals");
>> > 
>> > 
>> > On Mon, 07 Mar 2005 00:27:49 -0000, bilbo0211 <bilbod@xxxx> wrote:
>> >> 
>> >> 
>> >> I downloaded the Amibroker Demo and I am trying to backtest market
>> >> timing signals.
>> >> 
>> >> I put the buy/sell dates in a csv file and am trying to read it
> in and
>> >> convert it into buy/short arrays. I have not been very successful.
>> >> 
>> >> I cannot see my printf out output because I cannot figure out how to
>> >> display the output window.
>> >> 
>> >> The code is below.
>> >> 
>> >> Bill
>> >> 
>> >> function Date_To_Num(mm_dd_yyyy)
>> >> {
>> >>  mm_ = StrToNum(StrLeft(mm_dd_yyyy,2));
>> >>  dd_ = StrToNum(StrMid(mm_dd_yyyy,3,2));
>> >>  yy_ = StrToNum(StrRight(mm_dd_yyyy,4));
>> >>  Date_Num = (10000 * (yy_ - 2000)) + (100 * mm_) + dd_;
>> >>  RESULT = Date_Num;
>> >>  return RESULT;
>> >> }
>> >> 
>> >> procedure getSignalDates( filename)
>> >> {
>> >>  fh = fopen( filename, "r");
>> >>  if( fh )
>> >>  {
>> >>    while( ! feof( fh ) )
>> >>    {
>> >>      s=fgets(fh);
>> >>      Index = ValueWhen( DateNum() == Date_To_Num(StrExtract( s,1 )),
>> >> BarIndex(), 1);
>> >>      sig=StrExtract( s,0 );
>> >>      if( sig == "B")
>> >>      {
>> >>        Buy[Index]=1;
>> >>        Cover[Index]=1;
>> >>      }
>> >>      else
>> >>      {
>> >>        if( sig == "S")
>> >>        {
>> >>          Short[Index]=1;
>> >>          Sell[Index]=1;
>> >>        }
>> >>        else
>> >>        {
>> >>          if( sig == "C")
>> >>          {
>> >>            Sell[Index]=1;
>> >>            Cover[Index]=1;
>> >>          }
>> >>          else
>> >>          {
>> >>            printf( "ERROR in %s/n", filename );
>> >>          }
>> >>        }
>> >>      }
>> >>    }
>> >>  }
>> >>  else
>> >>  {
>> >>  printf("ERROR: file can not be found (does not exist)");
>> >>  }
>> >> }
>> >> 
>> >> Buy=Sell=Short=Cover=0;
>> >> getSignalDates( "d:/my\ programs/amibroker\fssignals");
>> >> for( i=0; i<BarCount; i++)
>> >> {
>> >>  printf("%d",Buy[i]);
>> >> }
>> >> 
>> >> 
>> >> Check AmiBroker web page at:
>> >> http://www.amibroker.com/
>> >> 
>> >> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>> >> Yahoo! Groups Links
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> > 
>> > 
>> > -- 
>> > Cheers
>> > Graham
>> > http://e-wire.net.au/~eb_kavan/
>> > 
>> > 
>> > 
>> > Check AmiBroker web page at:
>> > http://www.amibroker.com/
>> > 
>> > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.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
> 
> 
> 
> 
> 
> 
> 
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> 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/