Update 'specifications/0001_LanguageSyntax.md'

This commit is contained in:
斟酌 鵬兄 2022-10-18 09:13:41 +00:00
parent a7277b3d2d
commit 295caf508c

View File

@ -1,9 +1,18 @@
# Table of Contents
* [Action Statements](#action-statements)
* [SELL](#sell-statement)
* [BUY](#buy-statement)
* [Functions](#functions)
* [PURCHASING_POWER](#purchasing_power)
# Action Statements
## SELL Statement
```
[SELL] [Units] OF [Product]
FROM [Exchange]
WITH LIMIT OF [Units]
AND
[Other Action Statements]
FOR EVERY
@ -12,21 +21,32 @@ AND
AND/OR
[Units] OF [Product] [BOUGHT]
FROM [Exchange]/ANYWHERE
AS 'ACTION_NAME'
```
### Examples
#### Simple Sell
```
SELL 1 SHARES OF QQQ FROM "MyBrokerAccount"
```
#### Sell Trigger
```
SELL 1 SHARES OF QQQ
FROM "MyBrokerAccount"
WITH LIMIT OF 100 SHARES
FOR EVERY
2 SHARES OF QQQ_TOKEN SOLD
FROM "CoinBase"
AS 'My Hedge Trigger'
```
## BUY Statement
```
[BUY] [Units] OF [Product]
FROM [Exchange]
WITH LIMIT OF [Units]
AND
[Other Action Statements]
FOR EVERY
@ -41,11 +61,19 @@ AND
```
BUY 1 SHARES OF BTC_ETF
FROM "MyBrokerAccount"
WITH LIMIT OF PURCHASING_POWER( "MyBrokerAccount", "QQQ" )
FOR EVERY
1 BTC OF USD_BTC SOLD
FROM "CoinBase"
```
# functions
## PURCHASING_POWER
`PURCHASING_POWER( Exchange, Product )`
Returns the maximum [Units] of [Product] can purchase from [Exchange]
### Other things