Conditional OKCoin Futures Entry Orders with Post-Fill Stop Loss
Summary
This OKCoin futures automation waits for the latest price to cross a user-selected trigger level, then submits a limit order at a separately specified price and contract quantity. The settings allow selection of currency denomination, contract expiry, trade direction, and leverage. The program checks that it is connected to the intended futures exchange, sets the contract and margin level, and retries failed data requests and an unsuccessful initial order.
After the entry order is reported filled, the program monitors price for a stop-loss trigger. It then submits a closing order at a configured stop price, with up to two attempts. This is a sequential trigger-and-order workflow, not a guarantee of execution at the specified prices: the entry and stop orders are limit orders, and the code does not confirm that the closing order filled before exiting. It supplies no backtest or performance evidence, and execution depends on exchange responses and the configured isolated-margin account.
Key ideas
- The program waits for price to cross a chosen level before submitting an entry limit order.
- The entry is monitored until the exchange reports it filled, after which stop monitoring begins.
- A stop trigger submits a closing limit order at a separately configured price.
- The code retries some requests but does not verify that the final closing order filled.
- No backtest results or evidence of strategy profitability are provided.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.