This paper addresses a framework for expansion planning of an active distribution network (ADS) that supplies its downward active microgrids (AMGs) and it participates in the upward wholesale market to sell its surplus electricity. The proposed novel model considers the impact of coordinated and uncoordinated bidding of AMGs and demand response providers (DRPs) on the optimal expansion planning. The problem has six sources of uncertainty: upward electricity market prices, AMGs location and time of installation, AMGs power generation/consumption, ADS intermittent power generations, DRP biddings, and the ADS system contingencies. The model uses the conditional value at risk (CVaR) criterion in order to handle the trading risks of ADS with the wholesale market. The proposed formulation integrates the deterministic and stochastic parameters of the risk-based expansion planning of ADS that is rare in the literature on this field. The introduced method uses a four-stage optimisation algorithm that uses genetic algorithm, CPLEX and DICOPT solvers. The proposed method is applied to the 18-bus and 33-bus test systems to assess the proposed algorithm. The proposed method reduces the aggregated expansion planning costs for the 18-bus and 33-bus system about 44.04% and 11.82% with respect to the uncoordinated bidding of AMGs/DRPs costs, respectively.