Stage 4, day 14:
I'm done with all the tasks that I had to complete before being ready for the next test.
The program is now running. I'm just waiting for the next opportunity to see how the program does with the last batch of corrections.
Update:
I got my first trading opportunity traded. I'll need to increase the execution aggressiveness. I still got stuck in PAXG. The whole execution took again another 3 hours. Ideally, the whole thing should be completed in less than a minute.
On the positive side, the program completed the plan without any manual intervention. My creation is now able to fly on its own!
Now, I'll do a log postmortem analysis to see if things went as expected or if I'll still see rough edges in the execution that needs some polishing. By glancing quickly at the log, I cannot tell if the trading operation has been profitable or not... (not good).
The reason is that part of the way that the program work, it is adding up any residual amount found in the intermediary currencies balance. It turns out that due to one or two past unsuccessful tests, I had a significant amount in PAXG (about $60 worth of PAXG) before the last execution that got included. So of course, I have more BTC after than I had before. but the result got greased by the extra $60 baked in. I'll need to analyse the logs to get an accurate picture.
Here is where I think this is going: I'll probably find out that I have a X average execution success rate. The key to profitability will be to know what is my average loss so that I know where to raise the profitability bar used to determine if I pursue an opportunity or not when an opportunity is detected such that my average profit is higher than the average loss.
There is some code that I added for polishing that made me make a nice discovery. The whole execution game is to modify the price you are asking or bidding according to market conditions. Usually what happens, is that you allocate a fixed amount for a given order. When on the selling side, you can play all you want with the price, your input won't change. When buying, if you want to keep your input fixed, every time that you change the price, you need to tweak the volume as well since the input is the order cost.
First time that I did test that code, I did found that I could return to the initial price, yet the volume was slightly higher than the initial volume....
the discovery is this: You can tweak the volume to take advantage of how the exchange is rounding the cost so that you can get some extra crypto fractions for free. ie (not the exact numbers but you'll get the idea).
buying 0.00200033 BTC can have the exact same cost than buying 0.002 BTC. Granted, to only get a USD cent worth of BTC would require thousands of transactions but I think that I'll optimize my code to take advantage of that rounding side effect. I guess this is a known trick among the experts that I have just rediscovered... or maybe they just don't bother with it since it is such a small amount... I cannot stop thinking about the old 'Superman II' movie of my childhood where a programmer guy tweak his company pay system to have all those fractions of cents deposited in his account... He end up arriving at the office in a red convertible sports car the next morning... I cannot help but categorize my discovery into the same category of 'optimization'....
PPS: Actually, the superman movie memory (maybe it was in the first superman movie... I cannot tell for sure). It is strange that for a lot of things in my memory starts to get blurry as I get older but this particular memory from my childhood. I was maybe 6 years old is crystal clear in my mind and is actually inspiring me today in my BASE journey... Is it coincidence???
I'm done with all the tasks that I had to complete before being ready for the next test.
The program is now running. I'm just waiting for the next opportunity to see how the program does with the last batch of corrections.
Update:
I got my first trading opportunity traded. I'll need to increase the execution aggressiveness. I still got stuck in PAXG. The whole execution took again another 3 hours. Ideally, the whole thing should be completed in less than a minute.
On the positive side, the program completed the plan without any manual intervention. My creation is now able to fly on its own!
Now, I'll do a log postmortem analysis to see if things went as expected or if I'll still see rough edges in the execution that needs some polishing. By glancing quickly at the log, I cannot tell if the trading operation has been profitable or not... (not good).
The reason is that part of the way that the program work, it is adding up any residual amount found in the intermediary currencies balance. It turns out that due to one or two past unsuccessful tests, I had a significant amount in PAXG (about $60 worth of PAXG) before the last execution that got included. So of course, I have more BTC after than I had before. but the result got greased by the extra $60 baked in. I'll need to analyse the logs to get an accurate picture.
Here is where I think this is going: I'll probably find out that I have a X average execution success rate. The key to profitability will be to know what is my average loss so that I know where to raise the profitability bar used to determine if I pursue an opportunity or not when an opportunity is detected such that my average profit is higher than the average loss.
There is some code that I added for polishing that made me make a nice discovery. The whole execution game is to modify the price you are asking or bidding according to market conditions. Usually what happens, is that you allocate a fixed amount for a given order. When on the selling side, you can play all you want with the price, your input won't change. When buying, if you want to keep your input fixed, every time that you change the price, you need to tweak the volume as well since the input is the order cost.
First time that I did test that code, I did found that I could return to the initial price, yet the volume was slightly higher than the initial volume....
the discovery is this: You can tweak the volume to take advantage of how the exchange is rounding the cost so that you can get some extra crypto fractions for free. ie (not the exact numbers but you'll get the idea).
buying 0.00200033 BTC can have the exact same cost than buying 0.002 BTC. Granted, to only get a USD cent worth of BTC would require thousands of transactions but I think that I'll optimize my code to take advantage of that rounding side effect. I guess this is a known trick among the experts that I have just rediscovered... or maybe they just don't bother with it since it is such a small amount... I cannot stop thinking about the old 'Superman II' movie of my childhood where a programmer guy tweak his company pay system to have all those fractions of cents deposited in his account... He end up arriving at the office in a red convertible sports car the next morning... I cannot help but categorize my discovery into the same category of 'optimization'....
PPS: Actually, the superman movie memory (maybe it was in the first superman movie... I cannot tell for sure). It is strange that for a lot of things in my memory starts to get blurry as I get older but this particular memory from my childhood. I was maybe 6 years old is crystal clear in my mind and is actually inspiring me today in my BASE journey... Is it coincidence???