A little program to help with trading and gambling

in #investing8 years ago (edited)

Hello Gang!

A friend asked me to help him out with this little program. From the programming standpoint, it is simple – it implements certain calculations. Yet, the premise behind those calculations seems interesting, which completed me to share this program and discuss the premise itself.

This is the graph of the UGAZ stock.  As we can see, the price fluctuates roughly between $13 and $14 plus minus 50 cents.  Surely, one can make quite a profit if he or she buys at the lowest point and sells it at the highest.  Let’s say you have a 100k budget.  If you buy at $12.50 in this case 8,000 shares and then sell it at $14,500 you make 16 k.  Pretty good, assuming you do this every couple of days.

The problem is, though, you don’t know what would be the lowest possible price during this plunge.  If you buy too soon it might go down and you will have the repulsive feeling how your money is disappearing.  On the other hand, if you are waiting too long you might miss the moment completely and then will byte your elbows.

Therefore, experienced investors (as I was told) using a special averaging tactics allowing them on one hand not to lose on the trade and have a decent chance to make a purchase at a good price.

The essence of the tactic is the following:

You buy in several steps.  At first you buy a small number of shares and as the price drops lower and lower you buy proportionally more and more.  Surely if the price didn’t fall deep you won’t make much profit, but at least you’ve made some profit and you didn’t lose.  On the other hand, if you bought very low your accumulated average will be closer to the lowest price you bought the shares at since proportionally you bought more shares at lower price.

Here come two important questions:

  1. How to break down your investment so that it will gradually increase towards the last purchase?
  2. What would be the intervals at which you need to execute each such step?

Thus. The little program that I wrote does this dirty work for an investor.
In the example in the video I am using investment equal $100,000, and assigning 13 investment steps.

It calculates the percentage of investment and the amount of investment for each step.

 

That means that your first investment at higher price will be only 1.68% of the total investment or $1,678.32 and so on until the last, the most significant investment of $16,783.22

Th question now becomes when to make each such investment.  This is taken care of by selecting Fibs option.

This means that the first investment of $1,678.32 you make when the price falls to 0.9438 of the original price or $14.16, the second investment of $2, 167.83 you make when the price falls to $13,65 and so on.

Let’s that that the trend reversal happened at 12.60.  By that time, you made three investments for the total amount of $6,643.36, purchased 494 shares at an average price of $13.45.  If now the price went up and hit $15 again you will gain a profit of around $740.  That doesn’t seem like not much. 

However, imagine that you’ve invested all 100k at 14 and then the price keeps getting lower and lower and the trade reversal happened at $7.  You will be sweating bullets and most likely will get out of the trade with the loss.  While this strategy allows you to fill calm and only make a larger investment at a lower price.

Finally, you can have all this listed in a spreadsheet by clicking [Make CSV] file.

That's how it looks in action.

A similar strategy could be applied in stopping compulsive gamblers from losing all the money at once.

When you play against casinos casino have a 5% to 7% edge against you.  If you want to know why please watch this video by Adam Koo

So, when you're playing in a casino – assign yourself the total amount of your gamble and break it down to steps, just like in this program.

Let’s say you lose your first bet, then your 2nd bet and then 3rd,4th, 5th and 6th but then you won on the 7th. Because your 7th bet was larger than all previous your winning will recover your loss plus the profit. And then you leave the casino table. 😉

You can download the program by clicking here….

Sort:  

This is a martingale betting strategy. Only works if you can continue to outlast the continuing losses. upvoted because of programming not the strategy.

It isn't Martingale because you don't double down, but is having a finalized investment in mind, which is within your means.

Interesting :) Have you made profit since you have programmed this program?

Personally, I don't gamble or trade. As I described in my post, I made this program for a friend. However, the reason why he asked me to make it was the fact that he used this approach manually with great success, but he spent much time calculating all these values manually. :)

What I would advice is to get yourself a test account, try to trade using this approach and see the results.

Very interesting this program, thank you for this great discovery I will try right away :)

Thank you! It's my pleasure.

Thanks for this information.thanks for posting it.

Upvoted and followed.thanks.

This is good advice. It is smart to have a plan when investing/gambling. I will be keeping this technique in mind For my next investments.

Anything that gets me profit and not a loss is huge. Always nice feeling to buy at the floor.
I've made my share of mistakes trading along the way(buying high,selling low). Thanks for the great advice.

I am glad this turned out to be useful. Good luck with your investments!

There is a lot of info out there on technical analysis but not a lot on money management. Good job!

Thank you! I heard of the courses by Van. K Tharp on money management. However, to my knowledge, his classes are not free. LOL

If I may ask, What is the point of investing if you are not helping a company or an idea behind the company ? All you want to do is take a dip and make money from volatility. What cause is this helping ? Short and long positions are understandable but daily dipping ? Please enlighten me.

In my understanding, this is a much more conservative approach than martingale strategy. It takes advantage of volatility and builds more wealth for an individual investor. It has nothing to do with the company who issues the shares. However, there are crowds of traders like this on the net.

Coin Marketplace

STEEM 0.09
TRX 0.31
JST 0.031
BTC 104993.29
ETH 3711.36
USDT 1.00
SBD 0.61