looking for a platform or bot to trade options automated following signals from a local file.

Discussion in 'Automated Trading' started by rtw, May 6, 2019.

  1. rtw

    rtw

    regards to everyone.




    i have very recently learned that tradestation does have a couple of commands to print data to a text file.


    Print to File
    Print(File("c:\test.txt"), "Date ",Date:7:0," Last ",Close);

    File Append
    FileAppend("c:\test1.txt", NumtoStr(Date,0) + Spaces(2) + NumtoStr(Close,2) + Newline);



    i'm looking for trading platforms or other software that can take a line of text like "twtr buycall" (or twtr 4, twtr d, etc) written to a local text file, make all appropriate computations and send a twtr 190510c40 buy at ask limit order through ib's api.


    i would require that for every - uptrend has started - line, the system sent the appropriate buy call order through ib's api. this requires some elementary computations, first to determine which symbol (let's say twtr, if the alert was for twtr, for example) my system should buy a call for, then to determine the appropriate strike price (the last price for the underlying symbol at the time of the alert, rounded to the closest multiple of 5 to which it should then add or substract a fixed number of points), the expiration date would normally be the closest one and then the limit price for the contract (buy at 8/10ths between the bid and the ask for this particular contract, or as close to midmarket as possible). i think at this time it would also be necessary to put something like a "tag" (owned twtr calls, for example) on all contracts i have purchased, or put them in a owned twtr calls "set" so that my system would know which contracts to sell when the uptrend has ended.


    alerts that stated that an uptrend has ended should be transformed into orders to sell all calls, downtrend has started should buy a put with an identical process as that for calls just inverted and downtrend has ended should sell all puts.


    if anyone has been able to get similar systems to these to work or has any working examples of how to send orders for options through ib's api i would be most grateful if they can share their suggestions.



    very well, thanks for everything, regards.
     
    jonahern likes this.
  2. qlai

    qlai

    How aggressive will the orders be? Is the system expected to chase the market?
    This also implies subscribing and processing options data via IB.
    Also it sounds like you will keep positions overnight. So is the system responsible for tracking positions or will it be simply trading based on what the file tells it to?
    Getting a bit complicated :)
     
  3. rtw

    rtw


    qlai,

    thanks.

    about the first point you mention, it is not that i want my orders to be aggressive, it is just that if one is going to trade automated one has to make sure all entries and exits will be executed - filled when one's system generates them. when trading options, market orders should never be utilized, so i have been growing convinced that it will be necessary to use limit orders to buy at the ask and sell at the bid.

    and yes, the strategies i'm interested in automating do not generate a lot of trades per week. it is usually between 2 and 4 trades per symbol per week, so positions are typically held for one or more days. i would indeed need the tools i would use for automation to be able to determine which specific contracts were bought when a particular trend started so that they could then close those positions after a trend has ended.

    i have been devoting a lot of time into this matter and i have made substantial progress with a number of different open source platforms (tradebuild platform, quantconnect) and paid alternatives that could be used to automate options trading as intended. i have had to learn to code some of the actions the system will execute, i have also received invaluable guidance from people in specialized fora and i have also been able to find tremendous open source computing resources on the internet. i think that i should be able to finalize a system to trade options automated very soon.
     
    qlai likes this.
  4. jonahern

    jonahern

    I would also like...please cc me