Essentials Order Volume Precision and Price Precision Applicable to Various Exchanges
Python strategy by 陈皮.
PythonOther
The original spec has no written description. Read the source below.
Source Python
from collections import Counter
def GetAmountPrecision():
depth = _C(exchange.GetDepth)
amountPrecisions = []
for ask in depth["Asks"]:
i = ask["Amount"]
amountPrecision = 0
if str(i).count('.') == 1:
amountPrecision = len(str(i).split(".")[1])
amountPrecisions.append(amountPrecision)
amountPrecision = max(amountPrecisions)
return amountPrecision
def GetPricePrecision():
depth = _C(exchange.GetDepth)
pricePrecisions = []
for ask in depth["Asks"]:
j = ask["Price"]
pricePrecision = 0
if str(j).count('.') == 1:
pricePrecision = len(str(j).split(".")[1])
pricePrecisions.append(pricePrecision)
pricePrecision = Counter(pricePrecisions).most_common(1)[0][0]
return pricePrecisionPublished by 陈皮 on the FMZ strategy square · last modified 2021-09-25. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Essentials-Order-Volume-Precision-and-Price-Precision-Applicable-to-Various-Exchanges.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Dynamic Balancing Strategy Python VersionPython · Other
- Exchange Wash Trading and Mutual BrushingPython · Other
- Leek Protection Program Tang Anqi Channel Position Balancing StrategyPython · Other
- Paul The Gambler Lévy Gold EditionPython · Other
- Porting OKCoin Leek Harvester Multi Variety Version Annotated Python VersionPython · Other
- Python Example Using asyncio http to Obtain Market DataPython · Other