Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # OptionsGo File Format (version 1)
- OptionsGo file (`.txt` extension) is a plain text file (unicode or UTF-8 encoding) that uses line-based syntax. Each line can be only one of these but they can be in any order:
- 1. Command lines
- 1. Order lines
- 1. Text lines
- 1. Comment lines
- ## 1. Command Lines
- Command line begins with `@` sign immediately followed by command name, a whitespace, and value.
- ```
- @command value
- ```
- Command | Description | Sample
- -------- | ----------- | -------
- @version | Version of OptionsGo parser | @version 0.1
- @owner | Owner of the diary | @owner Thep
- @title | Portfolio title | @title Paper Trade
- @series | Series of the future | @series S50H19
- @index | Index | @index 1053.2
- @comm | Commission rate (Baht per contract) | @comm 80
- @date | Full date | @date 3 Jan 2019
- @time | 24-hour time | @time 14:45
- @year | Year | @year 2019
- @month | Month | @month 1
- @day | Day | @day 3
- @group | Start a new group | @group Cashflow
- @. | Shorthand for @group | @. Cashflow
- @ref | Order reference | @ref dog-01
- @# | Short for @ref | @# dog-01
- ### Tagged command
- #### Using `.group` Tag
- ```
- @group A
- LF @1017 x 1
- ```
- is equivalant to
- ```
- LF @1017 x 1 .A
- ```
- #### Using `#ref` Tag
- ```
- @ref dog1
- LF @1017 x 1
- ```
- is equivalent to
- ```
- LF @1017 x 1 #dog1
- ```
- #### Mixed Tags
- ```
- -- this order is in group A and has ref dog1
- LF @1017 x 1 .A #dog1
- ```
- #### Nested Tags
- Nested groups.
- ```
- -- no @group above this line.
- -- so the default group is "" (empty text).
- LF @1000 x 1 .A -- is in group "A"
- @group B
- LF @1706 x 2 -- in group "B"
- LF @1707 x 2 .L -- in group "A.L"
- @group C
- LF @1708 x 2 -- in group "B"
- -- this line will be ignored.
- @group .D -- . notation is not allowed here
- @group -- set group to default empty group again
- LF @1000 x 2 .E -- in group "E"
- -- you can use @. instead of @group all the time
- ```
- Using #ref in the @group line
- ```
- @group A #cat-1
- LC 1025 @25 x 2 -- ref is "cat-1"
- LC 1050 @11 x 2 #a -- ref is "cat-1.a"
- ```
- Nested refs.
- ```
- -- no @ref above this line
- LF @1000 x 1 #dog1 -- ref is "dog1"
- @ref dog2
- LF @1000 x 1 -- ref is "dog2"
- SF @1010 x 1 #TP -- ref is "dog2.TP"
- @ref dog3
- LF @1000 x 1 -- ref is "dog3"
- -- this line will be ignored.
- @ref #dog4 -- # notation is not allowed here
- @ref -- set ref to default empty ref again
- LF @1000 x 1 #TP -- ref is "TP"
- ```
- Refs are cleared when start a new group.
- ```
- @group G1
- @ref X
- LF @1000 x 1 -- ref is X
- LF @1001 x 1 #a -- ref is X.a
- @group G2 -- new group will clear the refs.
- LF @1002 x 1 #b -- ref is b, not X.b!
- ```
- #### Order Id
- Every order has a uniqued id as a running number start with 1.
- ### Command Effectives
- All commands are effected from that line downward. For example:
- ```
- @year 2019
- @month Jan
- @day 5
- LF @1055.2 x 2 -- order is belong to 5 Jan, 2019
- @day 6
- SF @1066.0 x 1 -- order is belong to 6 Jan, 2019
- @date Feb 1, 2019
- SF @1000 x 1 -- order is belong to 1 Feb, 2019
- @day 2
- SF @1000 x 1 -- order is belong to 2 Feb, 2019
- ```
- ## 2. Order Lines
- ```
- [order_status] order_action order_detail
- ```
- ### Order Status
- Order status is a single character that is optional. If you has this, you must separate it from the order_action with a space.
- Status | Description |
- :----: | ------ |
- o | Enabled order. *This is the default status*.
- x | Disabled order. This order was not happened and not included in payoff chart.
- | - | Planed order. This order is planed to take action in the future.
- ### Order Actions
- Action | Description
- :----: | --
- LF | Long future
- SF | Short future
- LC | Long call
- LP | Long put
- SC | Short call
- SP | Short put
- ## 3. Text Lines
- ```
- any other are free text. Can be either ภาษาไทย หรือ English or even emoji ⚔️.
- you can make paragraph with a blank line.
- This is the second line of the paragraph.
- becareful that not begin the line with order prefix.
- ```
- ## 4. Comments
- Comment starts with two dashes (--). Comment text is just a note for yourself and will not be considered as command, order, or text. We have two type of comments, full line comment.
- ```
- -- line comments
- ```
- and comment to the end-of-line.
- ```
- @title Hello -- end of line comment
- ```
Add Comment
Please, Sign In to add comment