# Support Board

Date/Time: Wed, 12 Aug 2020 15:20:04 +0000

## [User Discussion] - Cell J23 when using column L for BuyExit and Stop

 [2015-07-14 06:05:09] #1 CMG - Posts: 169 | Ending Date: 2020-09-04 Hi There, In a spreadsheet for trading I'm using cell L3 to exit a long position in two scenarios: when a profit target is reached or when losing, a stop price is reached. How do I "share" cell J23 for both scenarios if I want to exit with a limit order when there is a profit and a market order for the stop order. If I enter a formula (Eg: J14+0.25) to establish the limit price in J23 for when there is a profit (conditions met in L3), then this formula is also used when a stop is triggered by the conditions set in L3. I need to use a different formula in J23 for when the position is losing and a stop is triggered by the conditions in L3. I tried combining the two price exit formulas in J23 [ =OR(AND(J10>0,(J14+0.25)),AND(J10<0,J12)) ] and J72 set to L and this formula returns a TRUE or FALSE value and I noticed that the result is the same as leaving J23 blank and therefore "If the Limit or Stop price cell (J23) is set to 0 or is blank, then the Limit or Stop price will be set to the current Bid price." Attached orders are not an option as these require a fixed target and stop value and do not fit my strategy. The question is: How do I "share" cell J23 for both scenarios if I want to exit with a limit order when there is a profit and a market order for the stop order? Thanks
 [2015-07-14 13:01:31] #2 tomgilb - Posts: 2636 | Ending Date: 2020-12-03 Formulas in J22:J25 need to produce a price, not a TRUE/FALSE, which is used when K3:N3 go TRUE You can also use a formula in J72 based on a condition: =IF(J10>0,"L","M") Creating targets and stops with spreadsheet formulas can get complicated. I find it is usually easier to use the Trade Management for Study study to manage Attached Orders that are optionally placed with formulas in J80, J81. An additional advantage is OCO orders at the exchange in case of connection issues. The Trade Management for Study study is set to reference a spreadsheet subgraph (formula column) and the price-controlling formula is in row 3. Zeros are ignored. You can use two instances and two formula columns if you want to separate longs and shorts, or targets and stops. http://www.sierrachart.com/index.php?page=doc/doc_AttachedOrders.html#StudyControlledTargetsStops You can also combine it with exit formulas in L3, N3. (set "Cancel All Working Orders On Exit' to Yes).
 [2015-07-16 03:57:25] #3 CMG - Posts: 169 | Ending Date: 2020-09-04 Tomgilb, Thanks for the answer...just realized answer to my post did not come from Sierrra Support. Thanks Again