Stock-Trading Test Bed

 

If you buy or sell stocks, it’s handy to test your strategy before you put real money at risk. Researchers devised a fresh approach to simulating market behavior. 


What's new: Andrea Coletta and colleagues at Sapienza University of Rome used a Conditional Generative Adversarial Network (cGAN) to model a market’s responses to an automated trader’s actions.


Key insight: Previous approaches tested a simulated trader in a virtual market populated by other simulated traders. However, real-world markets tend to be too complex to be modeled by interactions among individual agents. Instead of simulating market participants, a cGAN can model aggregated sales and purchases in each slice of time.


Conditional GAN basics: Given a random input, a typical GAN learns to produce realistic output through competition between a discriminator that judges whether output is synthetic or real and a generator that aims to fool the discriminator. cGAN works the same way but adds an input — in this case, details about individual buy and sell orders and the overall market — that conditions both the generator’s output and the discriminator’s judgment. 


How it works: The authors built a simulated stock exchange based on the Agent-Based Interactive Discrete Event Simulation (ABIDES) framework to match buy and sell orders. They trained a cGAN to generate such orders based on two days of market data for Apple and Tesla stocks. Then they added orders by an independent trader.

  • The authors simulated the stock market as a whole by connecting these components in a feedback loop. The first time through the loop, the exchange received historical buy and sell orders; subsequent times, it received orders from the agent and/or the cGAN.
  • The exchange paired offers with purchases. Then it sent details for each order (price, volume, buy or sell, and time since the previous trade) and the market as a whole (best price, highest volume, average price, and time when the details were calculated) to the cGAN.
  • Given the details provided by the exchange, the cGAN generated a new order along with a wait time. After waiting, it passed the order to the exchange, which triggered the cGAN to generate another order.
  • For a half-hour within a period of several hours, an independent agent sent its own purchases to the exchange. In each of 30 minutes, it observed the trading volume and issued a buy order based on its observation. The authors set the volume: 1, 10, or 25 percent of the observed volume.


GANs are usually associated with image generation. This paper adds to a growing body of research showing that they can successfully generate data outside of perceptual domains.


Comments

Popular posts from this blog

Your AI pair programmer

The Many Faces of Genetic Illness

Image to Animation model