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

Re: [amibroker] Re: Writing "alert" file



PureBytes Links

Trading Reference Links

You may need a double \\ slash in your path_file name.  Test this by removing the C:\ and it should write the file in the
AB root directory.
 
JOE
 
 
----- Original Message -----
Sent: Tuesday, May 02, 2006 6:12 AM
Subject: [amibroker] Re: Writing "alert" file

Yes, I understand that. What I'm not sure of is exactly where to
place the code in my AFL or how to trigger it. I currently have
something similar to the following, but it's not giving me the
desired results:

// Begin Code Snippet
AlertIf( Buy, "", "Alert: "+Name(), 1 );
if (Buy=True)
{
      fh = fopen( "C:\alerts.csv", "a");
      if( fh )
      {
            fputs( Name()+","+DateTime()
+","+Close+","+High+"\n", fh );
            fclose(fh);
      }
      else
      {
            printf("Error opening file");
      }
}
// End Code Snippet

The alerts are showing up in Amibroker's alert window just fine. But
the alerts.csv file is never being appended.



--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
>
> if you open the file with an "a" instead of "w", AFL will append
file
>
> ----- Original Message -----
> From: "Mark & Jean Petereit" <petereits@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, May 01, 2006 7:49 PM
> Subject: [amibroker] Writing "alert" file
>
>
> > I know how to use fopen, fputs, fclose. But is there any trick to
> > programming AFL to append a line to a text file for every Alert
that
> > is triggered?
> >
> >
> >
> >
> >
> >
> > 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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS