Exporting Trade Life
Author: Assenzio
Creation Date: 1/24/2011 5:22 PM
profile picture

Assenzio

#1
Hello,

is there a way to export into a txt file the "Trade Life" window data in WLD 6.0 ?
profile picture

Eugene

#2
No, the "Trade Life" tab wasn't designed for copying to clipboard and/or saving the data to a CSV file (like other MS123 visualizers do). Given the current design of the visualizer, it might be too involved.
profile picture

Assenzio

#3
Okay,

so I need to implement a subroutine that export trades life (performance percent). I do not post the whole code since it is complicated at the moment. But following this blocks of code can you help to find why gaves me this error ?

No overload method 'TradesHolder' takes 3 arguments

CODE:
Please log in to see this code.


CODE:
Please log in to see this code.


CODE:
Please log in to see this code.


I have selected this method, to put all trades into a List (position,days,value) because then I need to do the average percent trend of all trades. This is a sample of my list:

1,1,0.6
1,2,1.2
1,3,2.1
2,1,-0.3
2,2,-1.5
2,3,0.1

and so on ... then I'll average, with another loop, all the trades stored into the list to obtain an average whole trade in this way (in the previous example):

1,0.15
2,-0.15
3,1.1

The next step will be adding future dates to obtain a future average trade life based on previous trades when a new trade pops on.
profile picture

Eugene

#4
QUOTE:
No overload method 'TradesHolder' takes 3 arguments

Hope this helps:
CODE:
Please log in to see this code.
profile picture

Assenzio

#5
Okay ... it works but ... why the one below (taken from the wealthscript guide, similar to my method) works without the remake of TradesHolder declaration ?

CODE:
Please log in to see this code.
profile picture

Eugene

#6
Because it doesn't try to use an inexistent method call (i.e. no overload takes 3 arguments):
CODE:
Please log in to see this code.

Compare to your call:
CODE:
Please log in to see this code.


profile picture

Assenzio

#7
Just for the records, this piece of code first export all trades of a strategy into an array and then write the bar by bar average percent move in the Debug Window of all single trades that appear in the TradeLife window.

Original is the Primary Series (you can use
CODE:
Please log in to see this code.
instead.

CODE:
Please log in to see this code.



Question: is it possibile to reduce the decimal part of the numbers to 2 or 4 in the Debug Window ? Is not a problem for me, anyway, since I have now to export this data into a file with futures date. Just curious.
profile picture

Eugene

#8
QUOTE:
Question: is it possibile to reduce the decimal part of the numbers to 2 or 4 in the Debug Window ?

That's a FAQ: How to reduce the number of decimal places for display/debug?
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).