Filter loop by ‘price’ with meta_query

Ok, found the problem.

I had to add 'type' => 'numeric', to my query.

So the final code looks like:

$adsAll = array(
    'post_type'  => $postType,
    'meta_key' => $metaKey,
    'orderby' => $orderBy,
    'order' => $order,
    'posts_per_page' => $PostsPerPage,
    'meta_query' => array(
        array(
            'key' => 'preco_anuncio',
            'value' => array('8700','500000'),
            'compare' => 'between',
            'type'    => 'numeric',
            ),
        ),
    );