} else
{
printf("ERROR: file can not be found (does not exist)");
}
}
b = Optimize("b", 9, 1, Count, 1);
Count = StaticVarGet("Count");
for(a = 0; a < Count; a++)
{
Row = StaticVarGet("Row"+NumToStr(a,1.0,0));
printf("Row: %g\n", Row );
}
Buy = a == 12; // random buy/sell conditions for test purposes
Sell = a == 2;
--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> Hi,
>
> Sorry for the absence. Looks like others have helped you out. As for
> your last question, the %g is as described in the link provided by
> AB. The \n is not associated with the % token at all, but rather is
> just part of the string being printed and is an escape character
> representing a "newline". Other similar characters are \t for tab,
> etc.
>
> http://msdn.microsoft.com/en-us/library/h21280bw(VS.80).aspx
>
> Mike
>
> --- In amibroker@xxxxxxxxxxxxxxx, "ozzyapeman" zoopfree@ wrote:
> >
> > Thanks! That finally works.
> >
> > One follow-up question on these printf special characters, like "%
> g\n".
> >
> > Where can I find more info on these? The AmiBroker help guide points
> > me to the following microsoft page. But the definitions there
> for "g"
> > don't seem to match.
> >
> > http://msdn.microsoft.com/en-us/library/hf4y5e3w(VS.80).aspx
> >
> > Also, in the AB help guide, they give an example of %gn without the
> \.
> > But in the snippet below, you use a \.
> >
> > I can't seem to find any other explanations in the help guide for
> > these special characters.
> >
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "tuzo_wilson" <j.tuzo.wilson@>
> wrote:
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "ozzyapeman" <zoopfree@> wrote:
> > > >
> > > > Thanks on the Count++. It's an improvement. But I still get
> wrong
> > > results:
> > >
> > > Oops...don't increment before writing out your data:
> > >
> > > good[count] = StrToNum(fgets(fh));
> > > printf("Number: %g\n", good[count] );
> > > count++;
> > >
> > > That should work.
> > >
> > >
> > > Tuzo
> > >
> >
>
|