NexusFi: Find Your Edge


Home Menu

 





Easylanguage Print to File Problem


Discussion in TradeStation

Updated
    1. trending_up 5,892 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

Easylanguage Print to File Problem

  #1 (permalink)
jalea148
ASHEVILLE, NC
 
Posts: 1 since Aug 2012
Thanks Given: 1
Thanks Received: 0

I need to print to multiple files within a Signal. For example, if the trade is long, I want to write to ABC if the trade is long and to DEF if it is short. Furthermore, the file names depend on the symbol itself. Ex., if the symbol is SPX, I might want to print to C:\DATA\SPXL.csv for long trades and C:\DATA\SPXS.csv for short trades. If the strategy is applied to a different symbol, the name would change.

The documentation indicates the file name is a string expression. However, it appears it is a string constant. If I build a string variable, FILENAME, and use it in the print expression:
print(File(FILENAME), ElDatetoString(Date));
this results in Error(#287)
File name expected here.
It appears Easylanguage is looking for quotation marks, but I'm not sure [and I don't know how to append them.]

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
Fu510n's Avatar
 Fu510n 
Suffield, CT
 
Experience: Advanced
Platform: MC, TS, Python, Rust
Broker: IB, IQFeed, TS, Kraken
Trading: ES, NQ, RTY, YM, CL, RB, 6E
Frequency: Several times daily
Duration: Seconds
Posts: 144 since Oct 2009
Thanks Given: 902
Thanks Received: 143

I don't believe dynamic filenames are currently supported (re: Print - MultiCharts) by Easy/PowerLanguage.

Quoting 
Print([OutputTarget],Expression1,Expression2,etc.)

The parameter inside the square brackets is optional.

Parameters

OutputTarget- an optional parameter; specifies an output target other then the PowerLanguage Editor Output Log; the parameter must be followed by a comma.

There are two optional output targets:

Printer - Specifies the default printer as the output target.
File("PathFilename") - Specifies an ASCII file as the output target; if the specified file does not exist, the file will be created.

Where:
PathFilename - a string expression specifying the path and filename.
If OutputTarget is not specified, the output will be sent to the PowerLanguage Editor Output Log.

You can always request that they enhance the Print API call to support dynamic filenames though there's no guarantee they'll do that or "soon" (plus it would make it a superset of functionality of TS EasyLanguage, but that's fine). You could also write a DLL yourself and do whatever you want in the external module - quite a bit more involved, but definitely doable.

My .02,
-Guy

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on August 13, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts