# Support Board

Date/Time: Thu, 07 Jul 2022 17:14:50 +0000

## [User Discussion] - Spread sheet exit entire position????

### View Count: 778

 [2014-04-04 16:42:55] #1 User14682 - Posts: 83 If I have multiple entries programmed at 1 lots and accumulate up to 5 total contracts how do I exit all 5 positions on one signal not just 1 contract. If you can help it would be greatly appreciated!!!! Thanks
 [2014-04-04 17:13:17] #2 tomgilb - Posts: 3335 The easiest way is probably using cell J29, or you could control the quantity with Cell J26 and use signals in L3, or N3.
 [2014-04-04 18:56:37] #3 User14682 - Posts: 83 How would I write the code? This is what I currently have and the quantities are set to 1 and I want to exit entire position =OR(AND(AA3AE4),AND(AA3AG4))
 [2014-04-04 19:21:21] #4 tomgilb - Posts: 3335 I'll assume that formula is for exiting a long position, so I'll create the opposite direction exit also. Put this in J29, and remove formulas in L3 and N3: =IF(J8>0,OR(AND(AA3AE4),AND(AA3AG4)),IF(J8<0,OR(AND(AA3>AE3,AA4AG3,AA40,OR(AND(AA4AE5),AND(AA4AG5)),IF(J8<0,OR(AND(AA4>AE4,AA5AG4,AA5