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, File Screener, Google Drive File and Google Drive Screener signal provider types.
There are three types of file formats: text, json, csv with the following file type extensions: .txt, .json, .csv

Note that all signal files should still have the .sig extension either by itself or followed buy the file type extension. ( i.e. oldstrat.sig, newstrat.sig.txt, newerstrat.sig.csv, lateststrat.sig.json are all valid files names while a file named strat.txt will not be processed).
We recommend using .sig.txt, .sig.csv and .sig.json extensions as they can be identified and thus (pre)viewed easier on mobile devices.

*IMPORTANT*
All files are processed OLDEST to NEWEST by the last modified time. When your strategy requires you to process files in a specific order, make sure the last modified time is set appropriately.

TEXT
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, STOP, TIF, TIFDATE, ID, EXITTARGET, EXITSTOP, REFPRICE, AFTERDATE, ALGO
The only mandatory fields, as with the text format, are TICKER and ACTION. Fields do not need to be capitalized.
You can also include column names that are not one of the above, these columns will simply be ignored.

Notes:
  • TIFDATE refers to the date specified for the GTD time in force.
  • AFTERDATE refers to the trigger time for delayed signals.

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

The following is a specific example for a Custom Target Order (see documenation)
TICKER,ACTION,ORDERTYPE,LIMIT,EXITTARGET
SPY,BTO,LMT,200,500
HPQ,E_TGT,,,400

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,Buying IBM today

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)