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 # Action Statements
## SELL Statement ## SELL Statement
``` ```
[SELL] [Units] OF [Product] [SELL] [Units] OF [Product]
FROM [Exchange] FROM [Exchange]
WITH LIMIT OF [Units]
AND AND
[Other Action Statements] [Other Action Statements]
FOR EVERY FOR EVERY
@ -12,21 +21,32 @@ AND
AND/OR AND/OR
[Units] OF [Product] [BOUGHT] [Units] OF [Product] [BOUGHT]
FROM [Exchange]/ANYWHERE FROM [Exchange]/ANYWHERE
AS 'ACTION_NAME'
``` ```
### Examples ### Examples
#### Simple Sell
```
SELL 1 SHARES OF QQQ FROM "MyBrokerAccount"
```
#### Sell Trigger
``` ```
SELL 1 SHARES OF QQQ SELL 1 SHARES OF QQQ
FROM "MyBrokerAccount" FROM "MyBrokerAccount"
WITH LIMIT OF 100 SHARES
FOR EVERY FOR EVERY
2 SHARES OF QQQ_TOKEN SOLD 2 SHARES OF QQQ_TOKEN SOLD
FROM "CoinBase" FROM "CoinBase"
AS 'My Hedge Trigger'
``` ```
## BUY Statement ## BUY Statement
``` ```
[BUY] [Units] OF [Product] [BUY] [Units] OF [Product]
FROM [Exchange] FROM [Exchange]
WITH LIMIT OF [Units]
AND AND
[Other Action Statements] [Other Action Statements]
FOR EVERY FOR EVERY
@ -41,11 +61,19 @@ AND
``` ```
BUY 1 SHARES OF BTC_ETF BUY 1 SHARES OF BTC_ETF
FROM "MyBrokerAccount" FROM "MyBrokerAccount"
WITH LIMIT OF PURCHASING_POWER( "MyBrokerAccount", "QQQ" )
FOR EVERY FOR EVERY
1 BTC OF USD_BTC SOLD 1 BTC OF USD_BTC SOLD
FROM "CoinBase" FROM "CoinBase"
``` ```
# functions
## PURCHASING_POWER
`PURCHASING_POWER( Exchange, Product )`
Returns the maximum [Units] of [Product] can purchase from [Exchange]
### Other things ### Other things