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

[amibroker] Re: AFL - Disk write



PureBytes Links

Trading Reference Links

It would have helped if you had included your formula. I think there 
is a limit of 1024 characters per line but I am not sure. I am 
thinking back over 20 years now. 

fputs has two arguments or parameters. If you use more arguments you 
will get this error. 

But are you trying to format data for the file write? If so that may 
be the problem. Try and separate your formatting to a text var and 
then use that as a parameter in fputs as I did below. This is the 
line, fputs(fputsString, fhw ); that writes to the file. I build or 
assembled fputsString earlier.

I appended a function I use to save trades to a file. This writes one 
line per call into a csv file. I create they directory and file in 
another include. If this doesn't help add your formula next time.

You can also look at a formula I use to save intraday data to file. 
It is in the AFL library. Search for my name or Export EOD or 
Intraday to CSV

Cheers,
Barry

// Save trade structure: time, symbol, function, status, ordID, 
contracts, price, close, condition text
// params: ordtype, oid, contracts, price, condition text
showText = true;	// use this in the show parm to control 
displaying the trade conditions
function fSaveTrade(func, OID, num, price, tradecond ) 
{ 		
	trdClose = NumToStr(LastValue(Close), 1.2);
	timestr = fFormatTime(sysTimeStr);
	if(StaticVarGet(VarPfx + "FirstFileWrite") )
		fhw = fopen( StaticVarGetText(VarPfx 
+ "FileName"), "w");
	else
		fhw = fopen( StaticVarGetText(VarPfx 
+ "FileName"), "a");
	if ( fhw ) 
	{
		if(StaticVarGet(VarPfx + "FirstFileWrite") )
		{
			fputs("System," + Filename + "\n", fhw); 
			fputs("Time, Symbol, Function, Order, 
OrderID, Contracts, Price, Close, Condition\n", fhw); 
		}
		fputsString =  timestr + "," + Name() + ","  + func 
+ "," + OID + "," + NumToStr(num, 1.0) + "," + NumToStr(price, 1.2) 
+ "," 
			+ trdClose + writeif(tradecond  != "", "," + 
tradecond, "") + "\n"; 
		fputs(fputsString, fhw );
	}
	StaticVarSet(VarPfx + "FirstFileWrite", False);
	fclose( fhw );
}

--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
>
> I am trying to write to a disk file ... getting an errot of "Too 
Many Arguments"
> 
> Is there a limit on number of arguments / number of characters ???
> 
> Thanks
> 
> Ara
>



------------------------------------

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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