File Append Headers - Easylanguage - futures io
futures io futures trading



File Append Headers - Easylanguage


Discussion in TradeStation

Updated by ABCTG
      Top Posters
    1. looks_one Mauro2393 with 4 posts (0 thanks)
    2. looks_two ABCTG with 4 posts (2 thanks)
    3. looks_3 rolandw85 with 2 posts (1 thanks)
    4. looks_4 SMCJB with 1 posts (1 thanks)
    1. trending_up 961 views
    2. thumb_up 4 thanks given
    3. group 12 followers
    1. forum 10 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

File Append Headers - Easylanguage

(login for full post details)
  #1 (permalink)
London
 
Experience: Intermediate
Platform: Tradestation
Trading: equities, options
 
Posts: 6 since Nov 2019
Thanks: 0 given, 1 received

Is it possible to have headers in the first row of the FileAppend function.

Eg: My current code is:
if Marketposition = 1 then
FileAppend("C:\Users\roland\Desktop\DT\Example.csv", Symbolname +","+ Numtostr(date + 19000000,0)+","+ Numtostr(Volume,0)+ Newline);

Is the only way to do this by adding more columns in front of each with a "header"? I just want my CSV to have headers on the top line if possible.

Reply With Quote
The following user says Thank You to rolandw85 for this post:

Can you help answer these questions
from other members on futures io?
Do you know what platform generates this kind of P&L
Platforms and Indicators
Spoofing,Bluff Orders, Manipulation?
Emini and Emicro Index
Contract-adjusted volume composite in Sierra
Sierra Chart
QDEL
Stocks and ETFs
Attempt to Divide by 0 Error
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on futures io
VWAP for stock index futures trading?
38 thanks
What Is the Source of Your Edge??
23 thanks
VWAP oscillator for NT8
15 thanks
Index options vs futures options
11 thanks
Battlestations: Show us your trading desks!
10 thanks
 
(login for full post details)
  #2 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,197 since Apr 2013
Thanks: 386 given, 1,432 received

Hi rolandw85,

you could write the header within a once block or "if CurrentBar = 1" conditional branching. Depending on how you write your files you might have to add additional checks to make sure the file doesn't exist yet, as FileAppend would otherwise append another header.

Regards,

ABCTG


rolandw85 View Post
Is it possible to have headers in the first row of the FileAppend function.

Eg: My current code is:
if Marketposition = 1 then
FileAppend("C:\Users\roland\Desktop\DT\Example.csv", Symbolname +","+ Numtostr(date + 19000000,0)+","+ Numtostr(Volume,0)+ Newline);

Is the only way to do this by adding more columns in front of each with a "header"? I just want my CSV to have headers on the top line if possible.


Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #3 (permalink)
London
 
Experience: Intermediate
Platform: Tradestation
Trading: equities, options
 
Posts: 6 since Nov 2019
Thanks: 0 given, 1 received


thanks. good idea. i clear the print log at the end of my code. this will work for what i am after.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Legendary Market Wizard
Houston, TX
 
Experience: Advanced
Platform: Trading Technologies
Broker: Primary Advantage Futures. Also ED&F and Tradestation
Trading: Primarily Energy but also a little ES, GE, GC, SI & Bitcoin
 
Posts: 3,590 since Dec 2013
Thanks: 2,877 given, 6,754 received

The annoying thing is, I find that often my header row is actually the 2nd row of the csv file rather than the first, especially if I'm doing optimizations and writing results.

Reply With Quote
The following user says Thank You to SMCJB for this post:
 
(login for full post details)
  #5 (permalink)
Pisa, Italy
 
 
Posts: 4 since Sep 2020
Thanks: 2 given, 0 received


ABCTG View Post
Hi rolandw85,

you could write the header within a once block or "if CurrentBar = 1" conditional branching. Depending on how you write your files you might have to add additional checks to make sure the file doesn't exist yet, as FileAppend would otherwise append another header.

Regards,

ABCTG

Hi,

I'm having some problems with fileappend, I need to save a .txt file for each alert generated by the Strategy filled Order.

could you please help me?

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,197 since Apr 2013
Thanks: 386 given, 1,432 received

Mauro2393,

what problems are you having?

Someone might be able to steer you into the right direction if you post the code that is giving you the problems.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #7 (permalink)
Pisa, Italy
 
 
Posts: 4 since Sep 2020
Thanks: 2 given, 0 received


ABCTG View Post
Mauro2393,

what problems are you having?

Someone might be able to steer you into the right direction if you post the code that is giving you the problems.

Regards,

ABCTG

I sent to you a message, anyway I will Explain here what i'm looking for.

I would need to write a few lines of code that would allow me to save as a text file all the alerts or emails generated by the Strategy Filled Order function of TradeStation's TradeManager.

if anyone can help me or write me a piece of code I would be very happy.

Reply With Quote
 
(login for full post details)
  #8 (permalink)
Pisa, Italy
 
 
Posts: 4 since Sep 2020
Thanks: 2 given, 0 received


ABCTG View Post
Mauro2393,

what problems are you having?

Someone might be able to steer you into the right direction if you post the code that is giving you the problems.

Regards,

ABCTG

Hi @ABCTG

this is the code that i have, i need that print just ones when change position (long, Flat, Short)

If i_mp = -1 then
string_text=symb_+","+"Sell"+","+"Market"+","+VersioneStrategia+newline;
Fileappend(string_path2,string_text);

Reply With Quote
 
(login for full post details)
  #9 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,197 since Apr 2013
Thanks: 386 given, 1,432 received

Mauro2393,

using the OrderFill event of a StrategyHost as outlined here https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=162710 might be the better approach as this way you can also get prints for partial fills or only print in case you are fully filled.

Regards,

ABCTG


Mauro2393 View Post
Hi @ABCTG

this is the code that i have, i need that print just ones when change position (long, Flat, Short)

If i_mp = -1 then
string_text=symb_+","+"Sell"+","+"Market"+","+VersioneStrategia+newline;
Fileappend(string_path2,string_text);


Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #10 (permalink)
Pisa, Italy
 
 
Posts: 4 since Sep 2020
Thanks: 2 given, 0 received


Hi @ABCTG

I've already tried with strategy host but seems to be working only with the Simulated account, my algorithm is for Forex and as you know forex is not anymore available on TradeStation.
this is the reason why I was asking something inside the code without using strategy host.
Do you know an easy way to do it?
Kind Regards,


ABCTG View Post
Mauro2393,

using the OrderFill event of a StrategyHost as outlined here might be the better approach as this way you can also get prints for partial fills or only print in case you are fully filled.

Regards,

ABCTG


Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > File Append Headers - Easylanguage


September 16, 2020


Upcoming Webinars and Events
 

An Afternoon With futures io member TropicalTrader

Elite only
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts