PureBytes Links
Trading Reference Links
|
Is this lne correct?
( "d:/my\ programs/amibroker\fssignals");
On Mon, 07 Mar 2005 00:27:49 -0000, bilbo0211 <bilbod@xxxxxxxxxx> 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/
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
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
<*> 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/
|