I am having some trouble with this, hope someone can help.

I want to limit the number of positions I can hold based on what watchlist the ticker is in.

*For example, I want to have 7 positions from currency market and 2 positions from bond market.*

So, A maximum of 7 open positions from my watchlist 6 (which contains 9 symbols) and a maximum of 2 open positions from my watchlist 7 (which contains 5 symbols). Symbols in both watchlists are different securities.

I want to be able to do this as part of one system so I can see the benefits of combining the different watchlists.

Some code I have got so far which is not working for me:

```
NumContracts = 1;
PositionSize = NumContracts * MarginDeposit;
RoundLotSize = 1;
if (InWatchList(6))
{
// Strategy 1 here
buy = MA(C,50) > MA(C,100)
AND C>Ref(HHV(C,100),-1);
sell = 0;
short = MA(C,50) < MA(C,100)
AND C<Ref(LLV(C,100),-1);
cover = 0;
SetOption("MaxOpenPositions",7);
Trail = Optimize("trail",5,3,7,1);
ApplyStop(stopTypeTrailing,stopModePoint, trail*ATR(20),2,True);
}
else
if (InWatchList(7))
{
// Strategy 2
buy = MA(C,50) > MA(C,100)
AND C>Ref(HHV(C,100),-1);
sell = 0;
short = MA(C,50) < MA(C,100)
AND C<Ref(LLV(C,100),-1);
cover = 0;
SetOption("MaxOpenPositions",2);
Trail = Optimize("trail",5,3,7,1);
ApplyStop(stopTypeTrailing,stopModePoint, trail*ATR(20),2,True);
}
```

Many Thanks in advance for any help