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 are not going anywhere` by itself would be sufficient.

Alternatively, if you wanted to express sorrow you could use something like:

> 
> And that's exactly why you're not going anywhere!
> 
> 
> 

A small bit of dialogue to back up my claim:

> 
> `Person A:` I used to love going out with you. The way we used to walk
>  in the park, went to restaurants and pretend it was your birthday and
>  just generally being around you. **sigh** I should've never left you
>  *Person B*.
> 
> 
> `Person B` And thats exactly why you're not going anywhere!
> 
> 
> `Person A:` We'll have to see what happens, not my choice to make
>  anyways.
> 
> 
>