  Plug-in electric vehicles (PEVs) can significantly increase the elasticity of
residential electricity demand. This elasticity can be employed to shape the
daily aggregated electricity demand profile of a system comprised of a large
number of residential PEVs' users sharing one electricity retailer or an
aggregator. In this paper, we propose a joint demand shaping and altering
algorithm for managing vehicle-to-grid (V2G) enabled PEVs' electricity
assignments (charging and discharging) in order to diminish the overall
electricity procurement costs for a retailer bidding to two-settlement
electricity markets, i.e., a day-ahead (DA) and a real-time (RT) market. This
approach is decentralized, scalable, fast converging and does not violate
users' privacy. Our simulations' results demonstrate significant overall cost
savings (up to 28\%) for a retailer bidding to an operational electricity
market by using our proposed algorithm. This becomes even more salient when the
power system is integrating a large number of intermittent energy resources
wherein RT demand altering is crucial due to more likely contingencies and
hence more RT price fluctuations and even more so-called \textit{black swan
events}. Lower electricity procurement cost for a retailer finally makes it
able to offer better deals to customers and expand its market capacity. This
implies that customers can enjoy lower electricity bills as well.
