Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
EasyLanguage and Excel - An Example
Updated January 31, 2013
Top Posters
looks_one
Big Mike
with 1 posts (0 thanks)
looks_two
arjfca
with 1 posts (0 thanks)
looks_3
TraderDoc2
with 1 posts (0 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
trending_up
11,891 views
thumb_up
11 thanks given
group
6 followers
forum
3 posts
attach_file
3 attachments
EasyLanguage and Excel - An Example
December 15th, 2011, 10:48 AM
Tulsa, OK
Experience: Advanced
Platform: Tradestation, TOS, Python
Broker: IQFeed, Tradestation, TOS
Trading: ES, SPY, Options
Posts: 201 since Jan 2011
Thanks Given: 339
Thanks Received: 258
Just wanted to share a quick example of how I'm using the Excel Class within TradeStation (ver 9.x). The Excel Class is documented pretty well and a demo is provided at https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=114780 (not sure if its OK to share that demo file here...so I'm just linking to it for those of you who have TradeStation accounts).
Some background:
I like to calculate my own pivots for indexes, futures and some stocks. I use these pivots as a general area of support/resistance and/or inflection. I use CSI Unfair Advantage for data and run an R script to pull data from CSI UA and then write out my Pivots.xls file every morning. This file is then used to auto-load my pivots, R's and S's in TradeStation .
The code below will read from the excel spreadsheet with worksheet name in the row given starting in the column given. It will then draw the Pivot , R's and S's on the chart for that symbol. I've attached the ELD, TXT version and my Pivots.xls file for your review.
Hope this is useful for others working with Excel and Tradestation. If you find any errors with this, let me know...i've been using it without issue for a few days now.
To use this, import the ELD and put the XLS on your "C:\" Drive (or change the path to the XLS to wherever you'd like to save it).
Code
{ set the namespaces that will be used }
using elsystem.office.excel ;
using elsystem.collections ;
using elsystem ;
{Inputs}
inputs:
string WorkbookName( "C:\Pivots.xls" ), { The path, filename, and extension must be correct for the file. }
string SheetName( "Pivots" ), { sheet where the information is located }
TimeBegin(0001),
TimeEnd(2359),
int column_cell(3), {this is the excel column that the Pivot is in. The program then takes and adds +1 to each column for he next # }
int row_cell(6); {this is the row in the excel sheet for this symbol.}
{Set my variables}
variables:
float PivotPoint (0.00),
float R1(0.00),
float R2(0.00),
float R3(0.00),
float S1(0.00),
float S2(0.00),
float S3(0.00),
Workbook WB1( NULL ); { Workbook object }
{ instantiate a new Workbook object and set its properties.}
once WB1 = new Workbook ;
once WB1.FileName = WorkbookName ;
once WB1.Shared = true ;
once WB1.Visible = false ;
once WB1.Load = true ;
once WB1.SaveOnClose = false ;
{ Get the pivot, R's and Support's from the excel file }
once PivotPoint = WB1.sheets[SheetName].CellsAsDouble[column_cell,row_cell] ;
once R1 = WB1.sheets[SheetName].CellsAsDouble[column_cell+1,row_cell] ;
once R2 = WB1.sheets[SheetName].CellsAsDouble[column_cell+2,row_cell] ;
once R3 = WB1.sheets[SheetName].CellsAsDouble[column_cell+3,row_cell] ;
once S1 = WB1.sheets[SheetName].CellsAsDouble[column_cell+4,row_cell] ;
once S2 = WB1.sheets[SheetName].CellsAsDouble[column_cell+5,row_cell] ;
once S3 = WB1.sheets[SheetName].CellsAsDouble[column_cell+6,row_cell] ;
{Set Pivot}
Value1=TL_New(D,TimeBegin,PivotPoint,D, TimeEnd,PivotPoint);
TL_SetColor(Value1,cyan);
TL_SetSize(Value1,0);
TL_SetStyle(Value1,Tool_dotted);
TL_SetExtRight(Value1,TRUE);
{Set S1}
Value3=TL_New(D,TimeBegin,S1,D, TimeEnd,S1);
TL_SetColor(Value3,RGB(255,128,0));
TL_SetSize(Value3,0);
TL_SetStyle(Value3,Tool_dotted);
TL_SetExtRight(Value3,TRUE);
{Set S2}
Value5=TL_New(D,TimeBegin,S2,D,TimeEnd,S2);
TL_SetColor(Value5,RGB(255,128,0));
TL_SetSize(Value5,0);
TL_SetStyle(Value5,Tool_dotted);
TL_SetExtRight(Value5,TRUE);
{Set S3}
Value7=TL_New(D,TimeBegin,S3,D,TimeEnd,S3);
TL_SetColor(Value7,RGB(255,128,0));
TL_SetSize(Value7,0);
TL_SetStyle(Value7,Tool_dotted);
TL_SetExtRight(Value7,TRUE);
{Set R1}
Value9=TL_New(D,TimeBegin,R1,D,TimeEnd,R1);
TL_SetColor(Value9,RGB(255,84,76));
TL_SetSize(Value9,0);
TL_SetStyle(Value9,Tool_dotted);
TL_SetExtRight(Value9,TRUE);
{Set R2}
Value11=TL_New(D,TimeBegin,R2,D,TimeEnd,R2);
TL_SetColor(Value11,RGB(255,84,76));
TL_SetSize(Value11,0);
TL_SetStyle(Value11,Tool_dotted);
TL_SetExtRight(Value11,TRUE);
{Set R3}
Value13=TL_New(D,TimeBegin,R3,D,TimeEnd,R3);
TL_SetColor(Value13,RGB(255,84,76));
TL_SetSize(Value13,0);
TL_SetStyle(Value13,Tool_dotted);
TL_SetExtRight(Value13,TRUE);
Attached Files
Elite Membership required to download: CUSTOM_PIVOTS_CSV.ELD
Elite Membership required to download: Pivots.xls
Elite Membership required to download: CUSTOM_PIVOTS_CSV.TXT
Thanked by:
Big Mike , DragonSpec , Emeraldo7 , itdirec , jaikumarm , Jura , loclhero , marejp , Matsegubben , paps , schkr
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
December 22nd, 2011, 08:35 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,392 since Jun 2009
Thanks Given: 33,170
Thanks Received: 101,530
Very nice, thanks for sharing.
Mike
January 31st, 2013, 04:33 PM
Montreal, Canada
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
Posts: 263 since Sep 2010
Thanks Given: 440
Thanks Received: 91
ericbrown
Just wanted to share a quick example of how I'm using the Excel Class within TradeStation (ver 9.x). The Excel Class is documented pretty well and a demo is provided at
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=114780 (not sure if its OK to share that demo file here...so I'm just linking to it for those of you who have TradeStation accounts).
Some background:
I like to calculate my own
pivots for indexes, futures and some stocks. I use these pivots as a general area of
support/resistance and/or inflection. I use CSI Unfair Advantage for data and run an R script to pull data from CSI UA and then write out my Pivots.xls file every morning. This file is then used to auto-load my pivots, R's and S's in TradeStation .
The code below will read from the excel spreadsheet with worksheet name in the row given starting in the column given. It will then draw the
Pivot , R's and S's on the chart for that symbol. I've attached the ELD, TXT version and my Pivots.xls file for your review.
Hope this is useful for others working with Excel and Tradestation. If you find any errors with this, let me know...i've been using it without issue for a few days now.
To use this, import the ELD and put the XLS on your "C:\" Drive (or change the path to the XLS to wherever you'd like to save it).
Code
{ set the namespaces that will be used }
using elsystem.office.excel ;
using elsystem.collections ;
using elsystem ;
{Inputs}
inputs:
string WorkbookName( "C:\Pivots.xls" ), { The path, filename, and extension must be correct for the file. }
string SheetName( "Pivots" ), { sheet where the information is located }
TimeBegin(0001),
TimeEnd(2359),
int column_cell(3), {this is the excel column that the Pivot is in. The program then takes and adds +1 to each column for he next # }
int row_cell(6); {this is the row in the excel sheet for this symbol.}
{Set my variables}
variables:
float PivotPoint (0.00),
float R1(0.00),
float R2(0.00),
float R3(0.00),
float S1(0.00),
float S2(0.00),
float S3(0.00),
Workbook WB1( NULL ); { Workbook object }
{ instantiate a new Workbook object and set its properties.}
once WB1 = new Workbook ;
once WB1.FileName = WorkbookName ;
once WB1.Shared = true ;
once WB1.Visible = false ;
once WB1.Load = true ;
once WB1.SaveOnClose = false ;
{ Get the pivot, R's and Support's from the excel file }
once PivotPoint = WB1.sheets[SheetName].CellsAsDouble[column_cell,row_cell] ;
once R1 = WB1.sheets[SheetName].CellsAsDouble[column_cell+1,row_cell] ;
once R2 = WB1.sheets[SheetName].CellsAsDouble[column_cell+2,row_cell] ;
once R3 = WB1.sheets[SheetName].CellsAsDouble[column_cell+3,row_cell] ;
once S1 = WB1.sheets[SheetName].CellsAsDouble[column_cell+4,row_cell] ;
once S2 = WB1.sheets[SheetName].CellsAsDouble[column_cell+5,row_cell] ;
once S3 = WB1.sheets[SheetName].CellsAsDouble[column_cell+6,row_cell] ;
{Set Pivot}
Value1=TL_New(D,TimeBegin,PivotPoint,D, TimeEnd,PivotPoint);
TL_SetColor(Value1,cyan);
TL_SetSize(Value1,0);
TL_SetStyle(Value1,Tool_dotted);
TL_SetExtRight(Value1,TRUE);
{Set S1}
Value3=TL_New(D,TimeBegin,S1,D, TimeEnd,S1);
TL_SetColor(Value3,RGB(255,128,0));
TL_SetSize(Value3,0);
TL_SetStyle(Value3,Tool_dotted);
TL_SetExtRight(Value3,TRUE);
{Set S2}
Value5=TL_New(D,TimeBegin,S2,D,TimeEnd,S2);
TL_SetColor(Value5,RGB(255,128,0));
TL_SetSize(Value5,0);
TL_SetStyle(Value5,Tool_dotted);
TL_SetExtRight(Value5,TRUE);
{Set S3}
Value7=TL_New(D,TimeBegin,S3,D,TimeEnd,S3);
TL_SetColor(Value7,RGB(255,128,0));
TL_SetSize(Value7,0);
TL_SetStyle(Value7,Tool_dotted);
TL_SetExtRight(Value7,TRUE);
{Set R1}
Value9=TL_New(D,TimeBegin,R1,D,TimeEnd,R1);
TL_SetColor(Value9,RGB(255,84,76));
TL_SetSize(Value9,0);
TL_SetStyle(Value9,Tool_dotted);
TL_SetExtRight(Value9,TRUE);
{Set R2}
Value11=TL_New(D,TimeBegin,R2,D,TimeEnd,R2);
TL_SetColor(Value11,RGB(255,84,76));
TL_SetSize(Value11,0);
TL_SetStyle(Value11,Tool_dotted);
TL_SetExtRight(Value11,TRUE);
{Set R3}
Value13=TL_New(D,TimeBegin,R3,D,TimeEnd,R3);
TL_SetColor(Value13,RGB(255,84,76));
TL_SetSize(Value13,0);
TL_SetStyle(Value13,Tool_dotted);
TL_SetExtRight(Value13,TRUE);
Hello
I don't have access to TradeStation site and I got interogation. Maybe a dummy question
What kind of functions could you get using using elsystem.office.excel ;
Do you know if this file is compatible with Multicharts ?
I'm working with Multicharts and I'm looking to convert to MC 64. But I need to find a way to keep my connection with Excel.
Have a good day
Martin
Last Updated on January 31, 2013