Stage 1, day 13:
I have been busy yesterday evening and today to add up code on top of what I have. My program has been running smoothly for close to 24h without any glitch. I'm very happy about that. Stability is very important for software meant to run 24/24 7 days a week....
Then out of nowhere. Boom. SEGV signal. Core dump.. no more program running. This has been very brutal. I did inspect the core dump.... My first suspicion was some heap corruption. That wasn't good news. If it takes 24h or more before manifesting itself... I could take a while before I find out the root cause.... I became obsess by this new problem. It has totally disrupted my thought process.
I went to dinner... Made some reading... I came back to the computer in the evening. I have learned about a tool to track down heap corruption named AddressSanitizer:
https://en.wikipedia.org/wiki/AddressSanitizer
It did turn out that the problem was much more simpler than that. I took a multi year break from programming that must be why but I caught myself doing junior errors. Maybe it is utopic to expect to write code, compile it the first time with no compile error, and run it and it works flawlessly on the first try. Very often, I'm very close from that utopia. but I did type of very silly errors.
1. Create a for loop with iterators but forget to increment the iterator causing an infinite loop upon entering the loop.
2. Call it mathematical dyslexia if you want but I wrote B - A when I meant A - B. The first time, I caught myself doing that, what it caused was cute. I was printing a negative time period instead of printing a positive one. but in what I did that caused the last crash. I have a time window that I start sliding when it reach 24h in length. To access the point array, I compute the index by subtracting the point time from the number of msecs from Epoch (big number). I was computing the number of second that I needed to move the point time zero. So I was doing 24h in seconds minus current time window size that is now bigger than 24h. this resulted into a negative number that ended up causing an out of bound array access.
Something that I did notice about my behavior.. It is that I naturally give myself some time to relax and enjoy myself. This must be from the script:
- Paced Working & Entrepreneurial Efforst To Steady The Approach/Drive/Motivation & Prevent Burnout
Something did happen yesterday... I was sit in front of the computer... and I was searching for the best name for a new variable. Then a diagram from a book that I must have read 15 years ago did pop into my head. I went to my bookshelf. try to find the damn book that I haven't seen for many years... I did never found it. I must have lend it to someone and the book never came back my way...
But my urge to look into the book was very persistent... I did remember what the book cover did look like... A vague memory of the title. So I went on amazon and I found the damn book... It did clicked when I saw the author picture... It looks like a funky groovy cool Indian guy... A very memorable picture. I bought the Kindle version for immediate access...
It turns out that the diagram inside the book didn't help me much for finding a good variable name.... but somehow reading again this book at this very moment was the right thing to do...
I started reading the first 2 chapters. and I made 2 realizations:
1. With the background and experience that I now have today... Reading the book now makes much more sense than when I was total finance newbie 15 years ago.
2. What is currently in my program current implementation/plan is documented as being the standard industry practices... that is:
trend following
mean reversal
and technical sentiment...
So that was very comforting that the simple design that I had in mind and wrote on the back of a napkin is actually what the bests are also doing....
I keep my program running in one of my monitors (I have 2). there is the hope that having it live in my face very often, it will allow me to confirm intuitions that I have and observe new market phenomenons that I previously didn't realize were present. It did happen this afternoon or yesterday evening. When something very specific happens, in all occurrences that I have witnessed, the market go in the predicted direction. When I have these ah ah moments, I write those ideas down. That is the best way to not forget good ideas.
As I'm adding more windows to the program, I'm entertaining the idea to have a 4-6 monitors setup with information popping in my face giving a good feeling of the market as I work... This sounds cool to me... Some are dreaming of possessing a powerful gaming rig... My thing is some weird nerdporn fantasy. 6 30 inches 4K monitors mounted on a wall... This insane dream is going add extra motivation...
Another weird desire... I want to purchase some powerful bitcoin miner hardware. My office is in the basement. It is winter and it is too cool for me in here... I could turn up the heater but why not purchasing a heater making money while it is heating the room.... This will be another purchase once bitcoins start to come in....
I have been busy yesterday evening and today to add up code on top of what I have. My program has been running smoothly for close to 24h without any glitch. I'm very happy about that. Stability is very important for software meant to run 24/24 7 days a week....
Then out of nowhere. Boom. SEGV signal. Core dump.. no more program running. This has been very brutal. I did inspect the core dump.... My first suspicion was some heap corruption. That wasn't good news. If it takes 24h or more before manifesting itself... I could take a while before I find out the root cause.... I became obsess by this new problem. It has totally disrupted my thought process.
I went to dinner... Made some reading... I came back to the computer in the evening. I have learned about a tool to track down heap corruption named AddressSanitizer:
https://en.wikipedia.org/wiki/AddressSanitizer
It did turn out that the problem was much more simpler than that. I took a multi year break from programming that must be why but I caught myself doing junior errors. Maybe it is utopic to expect to write code, compile it the first time with no compile error, and run it and it works flawlessly on the first try. Very often, I'm very close from that utopia. but I did type of very silly errors.
1. Create a for loop with iterators but forget to increment the iterator causing an infinite loop upon entering the loop.
2. Call it mathematical dyslexia if you want but I wrote B - A when I meant A - B. The first time, I caught myself doing that, what it caused was cute. I was printing a negative time period instead of printing a positive one. but in what I did that caused the last crash. I have a time window that I start sliding when it reach 24h in length. To access the point array, I compute the index by subtracting the point time from the number of msecs from Epoch (big number). I was computing the number of second that I needed to move the point time zero. So I was doing 24h in seconds minus current time window size that is now bigger than 24h. this resulted into a negative number that ended up causing an out of bound array access.
Something that I did notice about my behavior.. It is that I naturally give myself some time to relax and enjoy myself. This must be from the script:
- Paced Working & Entrepreneurial Efforst To Steady The Approach/Drive/Motivation & Prevent Burnout
Something did happen yesterday... I was sit in front of the computer... and I was searching for the best name for a new variable. Then a diagram from a book that I must have read 15 years ago did pop into my head. I went to my bookshelf. try to find the damn book that I haven't seen for many years... I did never found it. I must have lend it to someone and the book never came back my way...
But my urge to look into the book was very persistent... I did remember what the book cover did look like... A vague memory of the title. So I went on amazon and I found the damn book... It did clicked when I saw the author picture... It looks like a funky groovy cool Indian guy... A very memorable picture. I bought the Kindle version for immediate access...
It turns out that the diagram inside the book didn't help me much for finding a good variable name.... but somehow reading again this book at this very moment was the right thing to do...
I started reading the first 2 chapters. and I made 2 realizations:
1. With the background and experience that I now have today... Reading the book now makes much more sense than when I was total finance newbie 15 years ago.
2. What is currently in my program current implementation/plan is documented as being the standard industry practices... that is:
trend following
mean reversal
and technical sentiment...
So that was very comforting that the simple design that I had in mind and wrote on the back of a napkin is actually what the bests are also doing....
I keep my program running in one of my monitors (I have 2). there is the hope that having it live in my face very often, it will allow me to confirm intuitions that I have and observe new market phenomenons that I previously didn't realize were present. It did happen this afternoon or yesterday evening. When something very specific happens, in all occurrences that I have witnessed, the market go in the predicted direction. When I have these ah ah moments, I write those ideas down. That is the best way to not forget good ideas.
As I'm adding more windows to the program, I'm entertaining the idea to have a 4-6 monitors setup with information popping in my face giving a good feeling of the market as I work... This sounds cool to me... Some are dreaming of possessing a powerful gaming rig... My thing is some weird nerdporn fantasy. 6 30 inches 4K monitors mounted on a wall... This insane dream is going add extra motivation...
Another weird desire... I want to purchase some powerful bitcoin miner hardware. My office is in the basement. It is winter and it is too cool for me in here... I could turn up the heater but why not purchasing a heater making money while it is heating the room.... This will be another purchase once bitcoins start to come in....