I programmed a new robot that optimizes itself. It performs this optimization on the opening of a new bar. Currently, I am letting this idea bake for a while until I determine how I will want to release this product to the world. Initially, I thought that I would release the executable for free in the marketplace and release the code for the codebase. I still like that idea, it would give my ideas exposure, and this could lead to someone else creating something wonderful. It could also bolster my code due to receiving complaints, requests, and bugs. I think that the community can play a part in making my code better. Since I have plenty ideas for expanding this idea, I am not worried that I am giving away my money maker.

How does this robot self-optimize? Here is the secret, the robot tests each variable in the index indicator twice, so if an indicator has one hundred possible values, it takes each value and tries to perform a trade at that value going back a certain number of bars. Then it grades that value by how much money it would have won or lost by trading at that value. It is a bit more complex than that, but you are reading this to get more details, so here it is as follows.

The givens are that when an indicator crosses the overbought value from the top, a sell order is issued, a buy order is issued when an indicator crosses from below an oversold value to above an oversold value. For example, if overbought was set to 80 and the value of your indicator was 85 on the bar before last, and the value of the indicator on the last bar was 79 then a sell order would be issued. 85 -> 79 crosses 80 downwards, sell order issued. If oversold = 23 then 19 -> 27 upwards would create a buy order. What that mechanic as a given we can move on to the next phase.

So, this indicator takes every value for the indicator from the top value you would sell at and the bottom value you would buy at and runs a test, two tests more specifically. It runs a buy test on each value. For example, if the top value is 100 it takes the top value backtests it on the number periods selected in the inputs, lets day that is 144 periods. So it would see if buying at 100 and selling at 100 would have been profitable in the last 144 periods. If it is profitable, it retains that dollar amount. If it suffers a loss, it adds the loss a negative amount to the value of that indicator value. It does this until it runs out of periods to test and adds all the profitable with all the losses to retain a monetary value. Then the indicator moves on to the next lower indicator value and tests it for profitability. When it has tested all the values, it selects the value with the highest monetary amount and chooses it as the optimal buy-value. Next, it performs similar checks for the sell-value. When this is complete, it compares the best buy-value with the best sell-value and looks for a trade that is the best of the best.

Some of the ideas that I currently have for expanding this expert are to allow it to trade multiple currency pairs at the same time filtered by spread size. I could also include self-learning features by creating a ranking system. Of course, I could include more indicators to choose from instead of just RSI and MFI. If I give it enough thought, I may be able to include indicators that are not index indicators. Self-learning features are also possible to be added to this robot. Also, implement a forward testing feature. These improvements could become a viable product.

I don't know if this product will ultimately be profitable, but I do believe that it would be something that will be interesting to deal with for a while. Would writing a detailed manual generate more sales. Would a primer on how to trade using this robot increase the marketability of this robot?
Share it with friends: