|
JamesR
 Member
 Posts: 33
Joined: 1/7/2011
Location: Cotswolds, UK
User Profile |
I have created an OP script that automates all of my daily OT activities via a dialogue - nothing too fancy but gets my EOD Data, runs OT, does analysis and emails me any new signals, exits etc.
The only thing I have not been able to successfully achieve is to get it to email me a list of Open Position per Portfolio (in fact I am struggling to get a list of open positions without regard to portfolio!!!).
Can anyone point me in the right direction of how to enumerate a list of the currently open positions (I know how to build up the email and send etc. it is just finding the correct procedures to find the open positions I am struggling with).
Many thanks
James
|
|
JamesR
 Member
 Posts: 33
Joined: 1/7/2011
Location: Cotswolds, UK
User Profile |
Solved this now!!!!
|
|
Jim Dean
 Sage
       Posts: 3433
Joined: 3/13/2006
Location: L'ville, GA
User Profile |
Your solution to this useful task would be helpful to others, if you care to share :~)
|
|
JamesR
 Member
 Posts: 33
Joined: 1/7/2011
Location: Cotswolds, UK
User Profile |
Jim
Will do - I will cut that section of code out from the rest of the script and make a standalone that just does this bit.
Add a few comments and attach.
|
|
JamesR
 Member
 Posts: 33
Joined: 1/7/2011
Location: Cotswolds, UK
User Profile |
Attached is my solution. This allows me to get OT to send email reports of both open positions and open orders per account.
Note this uses a bit of a cheat - I could find no way of accessing the account names from within OT. So this script relies on the user manually setting up a directory somewhere on their PC and in that directory creating a set of files with names matching their OT Account names.
I just used Notepad to create a set of txt files with matching names.
This could be used to select which Accounts to report on (by missing out any you are not interested in).
If you can live with this limitation, then have a look at the script (or if you know a way of accessing the account names, maybe let me know!!!!)
Note that the script will try to send an email, but you need to fill in your email account details in the SendByEmail function and ensure you have put the email address you want to sent to in the almost last line of the SendPositionsandOrders function
Any questions - please shout - I have tried to put some sensible comments in the code to assist.
Attached file : SendPositionsandOrders.txt (6KB - 569 downloads)
|
|
Jim Dean
 Sage
       Posts: 3433
Joined: 3/13/2006
Location: L'ville, GA
User Profile |
Thanks James. Nice piece of work, there!
|