Hi -
I would like to output the bar-by-bar PL (and preferably inclusive of commissions). Where the sum of this bar-by-bar PL column would just equal the net PL for the time period
I am using setShareSize to determine position size within the strategy
I've tried with the following code inside the bar loop, however this doesn't equal the total net PL
Anything suggestions on how to achieve this?
Thanks
David
CODE:
Please log in to see this code.
Size:
Color:
QUOTE:
(and preferably inclusive of commissions)
This is not an option. As you can find in the QuickRef,
NetProfitAsOfBar returns the profit excluding commissions.
Size:
Color:
Ok... is it possible including Commissions?
Size:
Color:
No. Like I just mentioned in a
different thread, position sizing is an overlay that kicks in after your Strategy has finished executing all theoretical trades in Raw Profit mode with 1 share. So, no to commissions, position sizing, slippage etc. That's by design.
Size:
Color:
To frame this so my question is perhaps clearer, as I think we're getting wires crossed here
Is it possible to extract an equity curve on a bar-by-bar basis? (Gross, non-position sized, etc - whatever the required permutation looks like!)
Size:
Color:
I admit I should've been more precise. In addition to saying "no" to "commissions, position sizing, slippage etc.", I should've also mentioned equity curve (cash curve, drawdown curve etc). You could find the whys and whereabouts in the Wiki FAQ and several forum posts by Cone and yours truly.
To extract an equity curve, right-click on the Equity tab (or MS123 Visualizers tabs that support it), select "Copy Equity Curve Data to Clipboard".
Side note: why would you want to do it? We've got all sorts of performance visualizers to double up your analysis power.
Size:
Color:
To run any standard portfolio optimisation (weights across assets, strategies) you need to input returns over time
So my preference is to avoid doing this manually across larger portfolios or parameters
If this doesnt exist, then fine - but I do think it's a natural question to ask - apologies if it annoyed you!
Size:
Color:
It may be possible to achieve one way or another but to get there first I had to understand your objective. So if you're after exporting an equity curve (returns over time) programmatically then you might consider taking a look at this non-standard technique:
Interacting Dynamically with Portfolio Level Equity
Size:
Color:
Thanks
Size:
Color: