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.
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.
