Pyramiding out through stop loss?

Questions about MultiCharts and user contributed studies.
Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Pyramiding out through stop loss?

Postby Xyzzy » 28 Sep 2014

I have a question concerning stop losses when there are multiple entry orders (i.e., I've pyramided into a position).

Let's say hypothetically that I'm currently long three shares of AAPL. One share was bought at $60, one share was bought at $65, and one share was bought at $70. Thus, my average entry price is $65.

I then set a stop loss order using:

Code: Select all

SetStopShare;
SetStopLoss(10);
Since this is using SetStopShare (rather than SetStopPosition), I have a $10 stop loss per share, for a $30 total stop loss.

My understanding that this will generate a single stop order at my broker for all three shares. Is this correct? I.e., it will set a stop loss at my broker for all three shares for $55, which is $10 less than the average entry price of $65. If the stop is hit, then all three shares are sold together (for a total loss of $30), and I'll be flat.

I'd prefer instead to have a separate stop loss for each entry order. E.g., if I want a $10 stop loss per share, then there should be a first stop order for one share at $60 (for the $70 entry), a second stop order at $55 (for the $65 entry), and a third stop order at $50 (for the $60 entry).

Is there any way to do this efficiently using MultiCharts? I'm guessing that I could code this manually by iterating through the open orders, and then use "sell from entry ("...") at [stop price] stop". However, this seems like a chore. Is there any easier way to do this?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Pyramiding out through stop loss?

Postby Andrew MultiCharts » 29 Sep 2014

Hello Xyzzy,

If you use SetStopShare (or SetStopContract), your SetProfitTarget, SetStopLoss, SetBreakEven, SetPercentTrailing will generate separate exit order for each entry. In your example it will generate 3 exits instead of 1 to exit whole position. SetStopPosition is to exit the whole position with 1 order, no matter how many entries were there.


Return to “MultiCharts”