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:
- Command lines
- Order lines
- Text lines
- Comment 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 or @by or @author | Owner | @by Thep |
| @title | Portfolio title | @title Paper Trade |
| @series | Series of the future | @series S50H19 |
| @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 |
| @index | Index | @index 1053.2 |
| @^ | Shorthand for @index | @^ 1055.5 |
| @group | Start a new group | @group Cashflow |
| @. | Shorthand for @group | @. Cashflow |
| @ref | Order reference name | @ref dog-01 |
| @# | Short for @ref | @# dog-01 |
@group A
LF @1017 x 1
is equivalant to
LF @1017 x 1 .A
@ref dog-01
LF @1017 x 1
is equivalent to
LF @1017 x 1 #dog-01
@index 1055.5
LC 1075 @14 x 2
is equivalent to
LC 1075 @14 x 2 ^1055.5
-- this order is in group A
-- and has reference name as dog1
-- and ordered at index 1055.5
LC 1075 @14 x 1 .A #dog1 ^1055.5
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 "B.L"
@group C
LF @1708 x 2 -- in group "C"
-- this line will be ignored.
@group .D -- . notation is not allowed here
@group -- reset 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 -- reset ref to default empty ref again
LF @1000 x 1 #TP -- ref is "TP"
A single reference names can be use for multiple orders (Can be duplicated). References will be 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 -- starts new group, this will clear the refs.
LF @1002 x 1 #b -- ref is b, not X.b!
Every order has a uniqued id as a running number start with 1.
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
[order_status] order_action order_detail
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. |
| - | Planned order. This order is planed to take action in the future. |
| Action | Description |
|---|---|
| LF | Long future |
| SF | Short future |
| LC | Long call |
| LP | Long put |
| SC | Short call |
| SP | Short put |
Text will be displayed in Orders Tab.
any other are free text. Can be either ภาษาไทย or English or even emojis 🐄💨.
you can make a paragraph by a blank line.
This is the second line of the paragraph.
becareful that not begin the line with order prefix.
Uses @text or @: as a line prefix to make that line interprets as a text, not an order.
@text LC me please!
or
@: LC, SP, and LF are your upward weapons.
Comment starts with two dashes (--). Comment text is just a note for yourself and will not be considered as command, order, or text. Comments will not be displayed in Orders Tab. We have two type of comments.
This is a full line comment.
-- line comments
and this is an end-of-line comment.
@title Hello -- end of line comment
This is a text line, not a comment line.
- Don't forget to buy the milk.
This can be a comment line.
-------------
-- Comment --
-------------
@by YourName
@title Portfolio
@series S50H19
@date 20 Jan 2019
@group Today
@index 1050
SF @1055.0 x 1
LC 1050 @25.0 x 1


Version 0.2 is here
https://gist.github.com/surrealist/b53a604954c9a191e554b347255bbab7