Skip to content
All library documents

Automating a Limit Buy Followed by a Limit Sell

Article Strategy library · Author: 小草

Summary

This trading-terminal plugin automates a simple buy-then-sell sequence. The user sets a buy price, purchase amount, target sell price, and account-check interval. The script first cancels all pending orders, checks that the account balance can cover the purchase, and places a buy order. It then polls the account and, after detecting an increase in holdings, submits a sell order for the added amount at the chosen price.

The document describes the workflow and provides example parameter defaults, but gives no performance results or testing evidence. It is a basic execution utility rather than a strategy for choosing prices or managing a portfolio. The source also has practical limitations: it cancels every pending order, uses a fixed holding increase to detect a fill, and does not explain handling partial fills, rejected orders, fees, or a sell that remains unfilled. It includes no stop loss or timeout, so a position may remain open if the target is not reached.

Key ideas

  • The plugin places a buy order at a user-specified price and amount.
  • After detecting increased holdings, it submits a sell order at the specified target price.
  • The script cancels all pending orders before starting.
  • The example does not describe partial-fill handling, loss limits, or performance testing.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.