Question: I happened to write "You are not going anywhere near us", and I meant "You should not leave us". Reading it back later I realised that what I wrote probably means the opposite...

Is there a way to use "not going anywhere" in the intended meaning?

Answer: 
Some good examples already given in answers but I want to point out a couple of differences.

It is indeed the "near us" that did you in (as Yosef mentioned).

*"You're not going anywhere."*, is an idiomatic statement in English which can mean a couple of things:

1. **You are not going anywhere *without us*.** (as marcellothearcane pointed out)
2. **You are not going anywhere! OR You are not going anywhere young lady!** (the person is very upset/mad, probably the parent, and wants to protect their child or make sure they don't do something bad again so they are effectively "grounded". It's like saying, "You are grounded and not going anywhere!").
3. **You are not going anywhere.** (I'm not leaving you out of my sight - similar to #1 above but a subtle difference - because I care about you so much and you leaving would just tear me up inside. It's very much like saying, "No way, you are not going anywhere, because I would be so alone, or so worried, that I couldn't handle it").
You can use a double negative to swap this round, which is *a syntactic construction in which two negative words are used in the same clause to express a single negation*1, for example:

> 
> You are not going anywhere **without** us
> 
> 
> 

This would have the required meaning of:

> 
> You are going with us
> 
> 
> 

Beware of double negatives though, as they can be confusing and potentially poor grammar - 'I haven't taken *nothing*', a double negative, means 'I have taken everything.

You may find [this](http://examples.yourdictionary.com/examples-of-double-negatives.html) link about double negatives 
interesting.

1 [Dictionary.com](http://www.dictionary.com/browse/double-negative)