Page 1 of 1

Help with a little code please

Posted: Aug 22 2006
by gpw797
Trying to add file append to a working strategy but I can't get it to work. I want to see the strategy AND append the buy/sell to text file (whiach also works but not WITH the buy/sell code.

This is what I am trying to get working:

...... then
FileAppend("c:\trade.txt", "cxlplace,BUY,60000,MKT,,0" + NumToStr(Date, 0) + NewLine) and Buy ( "gw1" ) next bar at market ;

Posted: Aug 23 2006
by Alex Kramer
Please try the following:

...then begin
FileAppend("c:\trade.txt", "cxlplace,BUY,60000,MKT,,0" + NumToStr(Date, 0) + NewLine);
Buy ( "gw1" ) next bar at market ;
end;

Posted: Aug 23 2006
by gpw797
That compiled thanks! I will try today

Posted: Aug 23 2006
by gpw797
that compiled but stategy didn't show up on chart, I found work around, I can enter buy sell signals and also load the text append orders ...

BUT my format isn't quite right

the format I am trying to generate at end is:

"cxlplace,BUY,1,MKT,,0 ,2006082312300"

I need help with last part the date/time stamp

format is:
2006 - year (YYYY)
08 - month (MM)
23 - date (DD)
1230 (time)
plus extra 0 at end

I played around with CurrentDate AND CurrentTime but couldn't get it to work. Any ideas with this one?

Posted: Sep 04 2006
by Stanley Miller
I played around with CurrentDate AND CurrentTime but couldn't get it to work. Any ideas with this one?
What did you do to make it work? What kind of problems do you have? Please be more specific.

Posted: Sep 04 2006
by gpw797
I can't remember why I couldn't get it to work, I am trying another front end now that I don't need the date stamp thanks.