Product -> FinancialInstrument

This commit is contained in:
2022-10-22 04:10:27 +08:00
parent 36faffe882
commit 49043117e2
6 changed files with 28 additions and 24 deletions

View File

@@ -51,17 +51,17 @@ TODO
## SELL Statement
```
[SELL] [Units] OF [Product]
[SELL] [Amounts] OF [FinancialInstrument]
FOR [Amount]
FROM [Exchange]
WITH LIMIT OF [Units]
WITH LIMIT OF [Amounts]
AND
[Other Action Statements]
FOR EVERY
[Units] OF [Product] [SOLD]
[Amounts] OF [FinancialInstrument] [SOLD]
FROM [Exchange]/ANYWHERE
AND/OR
[Units] OF [Product] [BOUGHT]
[Amounts] OF [FinancialInstrument] [BOUGHT]
FROM [Exchange]/ANYWHERE
AS 'ACTION_NAME'
```
@@ -69,8 +69,12 @@ AS 'ACTION_NAME'
### Examples
#### Simple Sell
The following statements are identical
```
SELL 1 SHARES OF QQQ FROM "MyBrokerAccount"
SELL 1 UNIT OF QQQ FROM "MyBrokerAccount"
SELL 1 QQQ FROM "MyBrokerAccount"
```
#### Sell Trigger
@@ -87,17 +91,17 @@ AS 'My Hedge Trigger'
## BUY Statement
```
[BUY] [Units] OF [Product]
[BUY] [Amounts] OF [FinancialInstrument]
FOR [Amount]
FROM [Exchange]
WITH LIMIT OF [Units]
WITH LIMIT OF [Amounts]
AND
[Other Action Statements]
FOR EVERY
[Units] OF [Product] [SOLD]
[Amounts] OF [FinancialInstrument] [SOLD]
FROM [Exchange]/ANYWHERE
AND/OR
[Units] OF [Product] [BOUGHT]
[Amounts] OF [FinancialInstrument] [BOUGHT]
FROM [Exchange]/ANYWHERE
```
@@ -116,13 +120,13 @@ BUY 1 SHARES OF BTC_ETF
## PURCHASING_POWER
`PURCHASING_POWER( Exchange, Product )`
`PURCHASING_POWER( Exchange, FinancialInstrument )`
Returns the maximum [Units] of [Product] can purchase from [Exchange]
Returns the maximum [Amounts] of [FinancialInstrument] can purchase from [Exchange]
## CURRENT_PRICE
`CURRENT_PRICE( Exchange, Product )`
`CURRENT_PRICE( Exchange, FinancialInstrument )`
Returns the current price of a product from exchange

View File

@@ -13,7 +13,7 @@ BUY 1 SHARES OF BTC_ETF
```
{
Statement: BUY
Product: {
FinancialInstrument: {
Name: BTC_ETF
Amount: {
Value: 1