Remember this was the day there was a big dip that started the long climb we're on now.
This is not able to make any profit if the market trends one direction only. When the market is volatile, it reads trends and takes what advantage is available.
Market trending down = sell
Market trending up = buy
The net result is selling before a low, and buying before a high.
Close but backwards.
Market Trending Down = Look at buying
Market Trending Up = Look at selling
Once it's decided the trend is up (ask) or down (bid) it then compares the last transaction to the vwap.
The ratio of last vs vwap is used as a waterline to make the final determination that we will take an action.
If trend = down & last < vwap then buy
If trend = up & last > vwap then sell
Once we have decided to buy or sell, then we look at the ask, bid and trend arrows.
This gives us an indication of how much momentum is in the current trend and is used to calculate a weight.
current balance (BTC or USD depending on Bid or Ask) * weight = how much we will be trading with.
For instance, if we have 100 ticks in our ticker...
If of those ticks 60 were up and 40 were down, the trendarrow will be +20, the market is now trending up.
During that same time there were 75 instances where the bidArrow went up and 25 where it went down, the bidArrow is now+50
The last trade was 10.25, the vwap is 10.20.
Now is a good time to sell because there is enormous pressure in the market to buy.
So how much do we sell?
Let's assume we have 100 BTC.
trendArrow / ticker.size = 20/100 = 0.2
bidArrow / ticker.size = 0.5
(0.2 * 0.5) = 10% of our 100 BTC balance.
100BTC * 0.1 = 10BTC
So now we sell 10 BTC at market price for 102.5 local currency
Now an hour later the market has taken a dip.
We have 100 ticks in our ticker.
60 were down, 40 were up the trendArrow is now -20
There were 75 instances where the askArrow went down and 25 where it went up. The askArrow is now -50
The last trade was 10.20, the current vwap is 10.25
Our local currency balance is 102.5
(0.2 * 0.5) = 10% of our 102.5 local currency balance
102.5 * 0.1 = 10.25
We now buy 1.025 BTC for 10.25, this gives us a profit of 0.025BTC
Now imagine that each of these trends continue on average for about 30 minutes before reversing and during that time we place 10 trades essentially identical (since these conditions are really only present for about 10 minutes out of each 30 minute trend), this is a profit of 0.25BTC during that 30 minute period or .5BTC per hour.
24 * 0.5 BTC = 12 BTC or 12% profit in a day.
Hope that helps!
BTW new commit coming very soon, just trying to figure out how to cache the market profile to disk so I only have a single large commit today.