How to Calculate spreads for long - short intraday trading?
Author: duncan.heinz
Creation Date: 4/18/2013 8:41 AM
profile picture

duncan.heinz

#1
I've set up a trading system that uses data from 6 ETFs, and each morning picks one long and one short from the 6. The Pricepane is set to SPX to assure that I have a bar for every one minute tick and the 6 ETFs are brought in as External data. The trade routine captures the current close data at 0934, performs calculation and then makes a long and short selection to execute at the next bar. Currently, it exits at EOD but I would like to add a feature that allows exit based on achieving a certain percent net profit between long and short expressed as a percentage of amount invested. I've looked at the Glitch indicator strategy but haven't been able to figure out how to calculate the spread for each bar after the trade execution. Can you point me to any trading strategies that do a similar calculation?
profile picture

Eugene

#2
Well, expressing it "as a percentage of amount invested" is going to be difficult: Strategies are being pre-executed with 1 share before applying the position sizing overlay. If you're willing to drop this requirement, then it appears doable. Take a look at the QuickRef, Position property > NetProfitPercent. Is this OK for a start?
profile picture

duncan.heinz

#3
Yes, thank you.
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).