PDA

View Full Version : Specific formula needed


afitzhugh
06-22-2009, 11:37 AM
I have been using SD for several months now and feel comfortable with writing formulas, but have not been able to solve for the following situation:

Holding 2 stocks of 100 shares each, A & B, paid $5 for each and want to make a $1 profit.

To accomplish this you want to sell both A & B at the same time when the sum of the 2 positions (not the per share price) equals $11.

SD support says it cannot be done because the functions of EntryPrice and EntryShares can only reference a single stock. My thinking is there must be a way to solve this equation utilizing some other functions, but my brain hasn't gotten there yet.

Any help would be greatly appreciated.

Andy

magictrader
06-23-2009, 01:10 PM
I have been using SD for several months now and feel comfortable with writing formulas, but have not been able to solve for the following situation:

Holding 2 stocks of 100 shares each, A & B, paid $5 for each and want to make a $1 profit.

To accomplish this you want to sell both A & B at the same time when the sum of the 2 positions (not the per share price) equals $11.

SD support says it cannot be done because the functions of EntryPrice and EntryShares can only reference a single stock. My thinking is there must be a way to solve this equation utilizing some other functions, but my brain hasn't gotten there yet.

Any help would be greatly appreciated.

Andy

If you already own these and know your price sum target, then it should be easy to issue a sell side alert on both

You'll need 2 separate alerts, both with the same formula, for symbols A and B. one alert will sell A and the other alert will sell B.

Bar[Close,D,0,A] + Bar[Close,D,0,B] >= 11

Hope that helps!

Tony