More hedging example

This commit is contained in:
斟酌 鵬兄 2022-10-19 21:16:03 +08:00
parent 3a8bc6420f
commit c7a8dec173

View File

@ -118,8 +118,8 @@ If another trader hit ur ASK with a 20 shares of bid, then only 8 shares of his
### SELL Order
```
SELL 10 SHARES OF "QQQ_TOKEN"
FOR CURRENT_PRICE( "CryptoExchange", "QQQ_TOKEN" ) + 5 USD
WITH LIMIT OF 1000 USD
FOR CURRENT_PRICE( "CryptoExchange", "QQQ_TOKEN" ) + 5 BTC
WITH LIMIT OF 1000 BTC
FROM "CryptoExchange"
```
@ -127,14 +127,14 @@ SELL 10 SHARES OF "QQQ_TOKEN"
### BUY Order
```
BUY 10 SHARES OF "QQQ_TOKEN"
FOR CURRENT_PRICE( "CryptoExchange", "QQQ_TOKEN" ) - 5 USD
WITH LIMIT OF 1000 USD
FOR CURRENT_PRICE( "CryptoExchange", "QQQ_TOKEN" ) - 5 BTC
WITH LIMIT OF 1000 BTC
FROM "CryptoExchange"
```
## Hedging
### BUY Trigger for the above examples
### BUY Trigger for every QQQToken SOLD
```
BUY 1 SHARES OF "QQQ"
FOR CURRENT_PRICE( "StockExchange", "QQQ" )
@ -142,7 +142,26 @@ BUY 1 SHARES OF "QQQ"
FOR EVERY 1 SHARES OF "QQQ_TOKEN" SOLD FROM "CryptoExchange"
```
### SELL Trigger for the above examples
### SELL Trigger for every QQQToken BOUGHT
```
???
SELL 1 SHARES OF "QQQ"
FOR CURRENT_PRICE( "StockExchange", "QQQ" )
FROM "StockeExchange"
FOR EVERY 1 SHARES OF "QQQ_TOKEN" BOUGHT FROM "CryptoExchange"
```
### BUY Trigger for every BTC handed out
```
BUY 1 BTC OF BTC
FOR CURRENT_PRICE( "CryptoExchange", "USD.BTC" )
FROM "CryptoExchange"
FOR EVERY 1 BTC OF BTC SOLD FROM "CryptoExchange"
```
### SELL Trigger for every BTC received
```
SELL 1 BTC OF BTC
FOR CURRENT_PRICE( "CryptoExchange", "USD.BTC" )
FROM "CryptoExchange"
FOR EVERY 1 BTC OF BTC BOUGHT FROM "CryptoExchange"
```