Showing posts with label backtesting. Show all posts
Showing posts with label backtesting. Show all posts
Saturday, December 28, 2019
Backtest results delayed; /CL still mostly behaving, otherwise markets still crazy up
I have the Python software done to run the backtest I promised last week, but I found what looks like a bug in the data.
The software just writes a log file of its results and they were mostly like this:
GAIN: $ 240
GAIN: $ 360
LOSS: $ 470
GAIN: $ 560
... but there was one that came up
LOSS: $ 3500
I looked at the details and the data shows the loss in one day; options price spiking from $0.46 to $4.39 ... with the underlying spiking from $37 to $43 as well.
I then looked at the data more closely, and the underlying price shows different values for different option strikes all on the same day:
whenx | futures_close
------------+---------------
2016-04-04 | 35.70
2016-04-04 | 35.70
2016-04-04 | 35.70
2016-04-04 | 35.70
2016-04-04 | 35.70
2016-04-04 | 35.70
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 37.03
2016-04-04 | 46.19
2016-04-04 | 37.03
2016-04-04 | 41.90
2016-04-04 | 44.24
2016-04-04 | 48.89
2016-04-04 | 47.72
2016-04-04 | 37.03
I have a support request into iVolatility to get this figured out ... this is just an end-of-day dataset, not ideal for the test anyway, but geez! It shouldn't show this difference.
I'll get this figured out this coming week and be back with the test results next week.
Saturday, December 21, 2019
Oil trade results so far and backtest results coming
As regular readers know, I've developed a point of view that the price of oil should decline over time ... so far I've done only 3 live trades on a small account:
- Oct 2 -> Oct19 +$360 (expired worthless)
- Oct 17 -> Oct 31 +$700
- Oct 31 -> Nov 19 +$800
I had to clear out this small account to handle some domestic expenses, so I put on a paper trade with the more desirable "ratio strangle" selling 2 of the 66 calls and one of the 54 puts.
So far that one looks like a winner too, up $320 so far and with probably another week or so to run until I close it and take the "virtual profit".
So far so good ... but some potential customers just absolutely require backtesting before they will invest.
Today I downloaded a free set of end-of-day of /CL futures pricing from Quandl .. which gives me some indication of backtesting results:
- 2019 -- looks to have lost only 1 (of 13 or 14) potential trades due to run-up from 47 to 56 or so January 1 to 16 ....
I requested a quote on futures options data from Ivolatility, which I hope to get on Monday.
So I'm waiting until I get the actual data to publish actual backtest results. With any luck I'll have that this coming week.
Details coming then ...
Sunday, February 25, 2018
No trade this week; looking for the next one(s)
I am working with QuantGo data to find my next trade ideas. I made progress on importing the data I'm evaluating into a database using this toolset:
Python comes with a terrific feature in its CSV module: it can "sniff" the format of the CSV file in question and automagically figure out how to parse it:
I found SQLAlchemy to be well documented and a pleasure to use ...
Next more database design for auxiliary tables I will need to store the underlying values and the delta of the options, etc.
Also I found on a StackExchange site for quants a post on backtesting so I am trying Orats, but I'm not sure it can do what I want to do ...
More next week ...
Python comes with a terrific feature in its CSV module: it can "sniff" the format of the CSV file in question and automagically figure out how to parse it:
with open('example.csv', 'rb') as csvfile: dialect = csv.Sniffer().sniff(csvfile.read(1024)) csvfile.seek(0) reader = csv.reader(csvfile, dialect) # ... process CSV file contents here ..
I found SQLAlchemy to be well documented and a pleasure to use ...
Next more database design for auxiliary tables I will need to store the underlying values and the delta of the options, etc.
Also I found on a StackExchange site for quants a post on backtesting so I am trying Orats, but I'm not sure it can do what I want to do ...
More next week ...
Subscribe to:
Posts (Atom)







