---
title: How to prevent secondary orders from executing within your strategy pack/scripts
slug: how-to-prevent-secondary-orders-from-executing-within-your-strategy-packscripts
createdAt: 2022-06-06T09:56:03.000Z
---

In strategy packs with *Smart Rebalancing* enabled, it is logical that realized profits will get allocated to secondary signals on other strategies within the pack.
There is a method to prevent that by adding this small section of code to your script with the necessary logic adjustments to suit your buy/long and sell/short needs.


:::CodeblockTabs
Tuned Script

```apex
LongApproved = and(LongOpen,not(position_long))
ShortApproved = and(ShortOpen,not(position_short))

//Signal Push
out(signalIf(LongApproved, ShortApproved))
```

Pine Alpha

```none
```
:::

What this will do, is only open a trade if there is not already a position open on this strategy. (long, short or open).



