Viewing actual orders on a chart
Author: pedro1977
Creation Date: 10/3/2013 10:13 AM
profile picture

pedro1977

#1
Hello, I´m trying to find out if it´s possible maybe through an add-in, to display my actual trades (manual trades) along with the intraday chart, so I can see where my entries and exits took place.

Thank you,

Pedro
profile picture

Cone

#2
Click for Wiki How-to

Passing thought:
This is such a highly-requested feature, I wonder why every broker in the world doesn't already offer it?
profile picture

Eugene

#3
Like Cone pointed out, importing historic trades is already made possible to do in Wealth-Lab. However, as a trial user, the website will not allow to install Community Components:

FAQ: I can't download an Extension: the site says Wealth-Lab extensions are available only to Wealth-Lab Version 6 customers.
profile picture

pedro1977

#4
I just wanted to make sure it can do that before buying Wealth-Lab since this is a feature I´ve been searching for everywhere and nobody seems to have it. Can you tell me the name of the Component ? Maybe I can see the instructions, import formats and such ?

Sorry about that, just saw the link by Cone. Thank you all very much !!!
profile picture

Eugene

#5
Here's the extension that you'll need to install in order to import real (historical) trades:

Community Components library

After installing any extension, restart Wealth-Lab for the changes to apply. Should you have any issues, don't hesitate to contact us.
profile picture

pedro1977

#6
Yes, it works perfect for daily charts ! Then I tried to get it to work on intraday charts, I tried putting in the file Trades2.txt instead of :

AAPL;12-05-2009;Buy;124

I tried :

INDV13;10/02/2013 12:10;Sell;53120 (it´s an intraday 5-min series)

using

this.SimTradeFile2(@"C:\Data\Trades2.txt", @"MM/dd/yyyy HH:mm");

It doesn´t give any errors but the trades don´t appear.

Thank you,

Pedro
profile picture

Eugene

#7
One line is not enough to determine. Off the top of my head:

* you could be using a Sell for an inexistent long position,
* or trying to Sell while intending to establish a Short trade,
* or the bar doesn't exist at 12:10,
* or there is not enough capital to enter/exit 53120 shares,
etc.
profile picture

pedro1977

#8
Sorry about that, not enough detail. If I understood correctly, the last parameter is the traded price and not number of shares, right ? So I changed it to :

INDV13;02-10-2013 09:35;Buy;52480
INDV13;02-10-2013 09:55;Sell;52500
INDV13;02-10-2013 11:20;Buy;52660
INDV13;03-10-2013 09:00;Sell;52900

More lines, I´m using paper account 3, and I started with a buy to avoid the inexistent long position problem, all bars were checked and the prices traded on those bars and all bars exist at those times. No errors, just chart with no simbols.

I noticed that when I right-click on the chart (only this chart), the Buy/Sell/Cover/Short options are grayed-out, could that have something to do with it ? The data for the chart was imported using a text file.

Thanks,

Pedro
profile picture

Eugene

#9
What position sizing is selected (active) in the "Position Size" dropdown? Absent right-click trading options can happen when "WealthScript Override" or "Max % Risk" is selected. While the latter is not compatible with the 'SimTradeFile' methods, it makes sense to select "WealthScript Override" only if your text file contains trade size (which is not the case in your example). Try switching to 1-share Raw Profit mode.

On a related note, is there enough capital to buy the index at 52480 i.e. what is your starting equity? Is it enough to buy at least 1 share?

If none of these suggestions help, please attach the INDV13 data file. I don't need the complete file, October 2013 (only) is enough to test these 4 trades and debug what's going on. Note that the date format in your post #8 is different from the one in your reply #6, and so should be your SimTradeFile call.
profile picture

pedro1977

#10
It works perfect, thank you very much Eugene ! I had the wrong Position Size.
profile picture

Eugene

#11
Glad to have helped, Pedro.
profile picture

pedro1977

#12
Hi, need some more help here, please. I´m trying to input Trade size.

"Trade size can be specified in the file, and it is supported using Wealth-Lab version 5.6 and up (optional parameter)."

I can´t get the trade size to work on any of the formats. When I subtitute 2000 for the size in the first format, nothing happens.

Original format :

Short;QQQQ;25-06-2009;36;25-06-2009;35.5;2000
Long;AAPL;12-05-2009;124;26-05-2009;130.4

I actually prefer to generate the file in the SimTradeFile2 format and in the description it says "Every bit of the description above applies to it, and the only difference is in the file format", I´m wondering if it also has the optional parameter of trade size and what the input file format would be ? I tried adding as a last field, didn´t work.

SimTradeFile 2 format :

AAPL;12-05-2009;Buy;124
AAPL;26-05-2009;Sell;130.4
QQQQ;25-06-2009;Short;36
QQQQ;25-06-2009;Cover;35.5

Is the source code available for SimTradeFile ?

Thank you



profile picture

Eugene

#13
QUOTE:
I´m trying to input Trade size.

Set the position size to "WealthScript Override (SetShareSize)".

QUOTE:
Is the source code available for SimTradeFile ?

Yes, it's part of Community Components.
profile picture

pedro1977

#14
QUOTE:
Set the position size to "WealthScript Override (SetShareSize)".

I´m trying to input trade size for each individual trade using a text file and method SimTradeFile2. If I understood correctly, I only need the input file format, with trade size, which is not described. "Trade size can be specified in the file".

I looked up "WealthScript Override (SetShareSize)" and it seems to apply to entry/exit rules and not to individual trades with varying trade sizes coming from a text file. Sorry, maybe I didn´t understand what you were saying.

profile picture

Eugene

#15
In addition to adding trade size to your text files, you need to select "WealthScript Override (SetShareSize)" for the thing to work. Hope this is clear now.
profile picture

pedro1977

#16
Ok, I got it. One more question : is it possible to Cover or Sell less than the full position ? Or is there a workaround this ?
profile picture

Eugene

#17
No, it's not. Partial exit would make the solution more complex and likely error prone.
profile picture

pedro1977

#18
No error or complexity. All data comes from the text file. It´s a monitoring/benchmarking Strategy right now, trade decisions are already made and executed elsewhere and position management is correct. The end goal will be to automate the strategy, hopefully soon :)

INDV13;11-10-2013 09:05:00;Short;52880;1
INDV13;11-10-2013 09:10:00;Short;52880;1
INDV13;11-10-2013 09:15:00;Short;52860;1
INDV13;11-10-2013 10:00:00;Cover;52855;2
INDV13;11-10-2013 10:15:00;Short;52840;3
INDV13;11-10-2013 10:30:00;Cover;52610;4

If it´s able to take the trade size argument for Buy and Short, why not for Sell and Cover ?
profile picture

Eugene

#19
QUOTE:
If it´s able to take the trade size argument for Buy and Short, why not for Sell and Cover ?


Because you can't make partial exits in Wealth-Lab in shares. As I just said, "partial exits would make the solution more complex and likely error prone". One would either have to approximate shares to exit with SplitPosition, or perhaps build a special PosSizer to accompany the method. Pretty cumbersome and not worth the trouble.
profile picture

pedro1977

#20
Sorry for insisting, but I cannot change the strategy I´m trying to evaluate/reproduce. No programming experience, but would something like this maybe work for a SimTradeFile2 multiple positions version ?

CODE:
Please log in to see this code.


Tried to compile it, gives an error "Community.Components.PositionHelper is obsolete (CS0612)" and Build fails.
profile picture

Eugene

#21
"Something like this" is just a single line of code (above) that you added to SimTradeFile2. At the risk of repeating, it's not nearly that simple. ;) But if somebody wants to contribute his efforts to extend our open-source solution (or create a new one), he's welcome to do it. Please don't count on me, though.
profile picture

pedro1977

#22
Sorry for underestimating the problem and the solution, just trying to learn how to do it. More than willing to do the work. Could you point me in the right direction, please ?
profile picture

Eugene

#23
I do not know what would be the right direction, and whether it's going to work out or not, so the choice is up to you. For SplitPosition see the QuickRef, for PosSizer you'll find it in the Wiki: Coding my own PosSizer.

There's another solution by a Wealth-Lab community member that is advertised as capable of creating additional transactions to split or aggregate to handle actual share size for either buy or sell transactions, but I'm not sure if this is what you're looking for as I haven't tried it out:

Import historical trades from Quicken reports (QuickenFile)

Good luck with your venture. Hope that helps.
profile picture

pedro1977

#24
Thank you very much Eugene ! Will get right on it.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).