EasyLanguage and Excel - An Example - futures io
futures io futures trading



EasyLanguage and Excel - An Example


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two ericbrown with 1 posts (10 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 arjfca with 1 posts (0 thanks)
    1. trending_up 10,125 views
    2. thumb_up 10 thanks given
    3. group 6 followers
    1. forum 3 posts
    2. attach_file 3 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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
 

EasyLanguage and Excel - An Example

(login for full post details)
  #1 (permalink)
Tulsa, OK
 
Experience: Advanced
Platform: Tradestation, TOS, Python
Broker: IQFeed, Tradestation, TOS
Trading: ES, SPY, Options
 
ericbrown's Avatar
 
Posts: 201 since Jan 2011
Thanks: 339 given, 253 received

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
Register to download File Type: eld CUSTOM_PIVOTS_CSV.ELD (8.6 KB, 145 views)
Register to download File Type: xls Pivots.xls (23.0 KB, 168 views)
Register to download File Type: txt CUSTOM_PIVOTS_CSV.TXT (2.9 KB, 135 views)
Follow me on Twitter Started this thread Reply With Quote
The following 10 users say Thank You to ericbrown for this post:

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,765 since Jun 2009
Thanks: 32,302 given, 97,542 received


Very nice, thanks for sharing.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
Montreal, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
 
Posts: 263 since Sep 2010
Thanks: 440 given, 91 received


ericbrown View Post
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

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > EasyLanguage and Excel - An Example


Last Updated on January 31, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 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