Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Formats
#1
File Formats
The different file formats give you freedom in how you want to create/store signals, and can be set using the File Type field under the Local File and File Screener signal provider types.
There are three types of file formats: text, json, csv. Note that all signal files should still have the .sig extension.

The text format is described in the Stock Signals and Stock Screeners threads.
Make sure you have read these threads first in order to understand what makes up a stock signal/screener.

CSV
The csv file is for table formatted signals (comma separated values).
You can specify which columns you want to include (in any order) out of TICKER, ACTION, QUANTITY, UNIT, ORDERTYPE, LIMIT, TIF, ID.
The only mandatory fields, as with the text format, are TICKER and ACTION.
You can also include column names that are not one of the above, these columns will simply be ignored.

Here are some sample csv formatted signal files

TICKER,ACTION,date,comment,QUANTITY,UNIT,ORDERTYPE,LIMIT
AAPL,BTO,20180909,buy apple,,,,
IBM,LONG,20180909,long ibm,100,SHARES,LMT,100

ACTION,TICKER
LONG,APPL
CLOSE,IBM

Notice that you can leave fields you don't need blank. You only need to fill out fields such that the signal is valid.

The csv file format for screeners is very similar, except that only the ACTION and TICKER columns will be read, and the only valid ACTIONS are BUY/SELL (as usual for screeners).
The order of tickers in the screener is from top to bottom, similar to the text format.

ACTION,TICKER,comment
BUY,APPL,
BUY,IBM,buy ibm

JSON
The json file format allows for signals to be directly decoded from a json string, and it is only available for signals (and not screeners) as of now.

The file should contain a single JSON object that is a list of JSON formatted signals.
The valid signal fields are: Action, Quantity, Unit, Symbol, TimeInForce, OrderType, LimitPrice, SignalId.
Of these fields, Action and Symbol are mandatory.

Here is a sample json formatted file:

[
    {
        "Action" : "BTO",
        "Symbol" : "AAPL"
    },
    {
        "Action" : "LONG",
        "Symbol" : "IBM",
        "Quantity" : 100,
        "Unit" : "SHARES",
        "OrderType" : "LMT",
        "LimitPrice" : 100
    }
]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)