Help with a little code please

Questions about MultiCharts and user contributed studies.
gpw797
Posts: 138
Joined: 04 Mar 2006
Been thanked: 4 times

Help with a little code please

Postby gpw797 » 22 Aug 2006

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 ;

User avatar
Alex Kramer
Posts: 834
Joined: 23 Feb 2006

Postby Alex Kramer » 23 Aug 2006

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;

gpw797
Posts: 138
Joined: 04 Mar 2006
Been thanked: 4 times

Postby gpw797 » 23 Aug 2006

That compiled thanks! I will try today

gpw797
Posts: 138
Joined: 04 Mar 2006
Been thanked: 4 times

Postby gpw797 » 23 Aug 2006

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?

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 04 Sep 2006

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.

gpw797
Posts: 138
Joined: 04 Mar 2006
Been thanked: 4 times

Postby gpw797 » 04 Sep 2006

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.


Return to “MultiCharts”