Update 2018: This project has been put on hold until Trading View released web hook support, as the SMS notifications were not open-ended and as such would expire, which would cause you to lose money because trades would cease if you forgot to renew the SMS hook, which was too manually fragile to justify maintaining.
This project is the automated trading setup used by Benjamin Lupton, codenamed
baltrade, which already accomplishes:
- Trading View strategies are saved into the
- Trading View strategies are added to the the Trading View interface, to see how they perform via Trading View's backtesting feature
- Trading View alerts are created via the study that accompanies the strategy (as Trading View strategies do not support alerts)
- Use Trading View's Server-Side SMS Alert feature to send the alert to a Twilio number
- Use the Twilio number to send the message via Web Hook to a Firebase Function that parses it
- Use the Firebase Function to act upon the alert message, with the usual intention of placing a trade via one or more intended Exchange APIs
That is to say, this is already a working solution for placing automated trades with various exchanges via Trading View strategies.
With enough effort, it will also accomplish:
- Storage of trade data for historical reporting of profit and loss against strategies and securities
- Storage of market data for more advanced strategies that can be operated independently of Trading View
- An app that allows users to register, browse strategy performance, and connect their portfolios to the strategies
- A marketplace for acquiring and renting strategies (%/$ on profits/month/trade)
- Public/Private user profiles, automated trade performance, and portfolio size
Difficulties with this vision are:
- Trading View offers no API for
- injecting strategies against securities
- injecting alerts on those strategies
- In order for Trading View to successfully send an alert, it requires a perfect balance of:
- Correct strategy and study setup, including correct input options
- Correct chart and change duration setup
- Correct connection between the strategy and the chart for correct alert setup
- Ensuring that none of this automation configuration changes in the process of just using trading view for everyday things
- A Premium Trading View plan in order to get access to their Server-Side SMS Alert feature, the only alert feature that sends alerts even when you have Trading View closed
- Trading View has a few unexpected features/bugs:
- Backtesting on Renko charts places realtime virtual trades at non-realtime prices, producing falsely optimal results
valuewhen(change(series), series, ForLoopIteration)does not seem to work as expected when inside a for loop, it seems to always produce the same result
- There is no logging or debugging in pine script, which makes figuring out the unexpected implausible
This would be assisted by either:
- Moving away from Trading View
- This may happen in 2018, as currently other backtesting solutions seem of alpha quality
- This would also allow potentially more advanced trading strategies, such as AI based ones
- Working with Trading View to solve the earlier issues
- A combination of both of the above; where this service evolves into an automated trading empire, where the strategies is a seperate empire which connects to this one, allowing any strategy service to connect to this user-facing (automated) trade placement solution
How to help:
- Trading View strategies
- You can help me improve my current strategies
- You can write new strategies and add them
- More exchanges
- Feel free to add support for more exchanges, I will happily merge them
- User-facing app
- We can work together on the user facing app, that will allow users to register, add their exchanges, and view performance
- You can review what has been done and help me improve it, especially from a security perspective
- You can help me connect a team/location/mentors/funds to build this out, make it into a product and a business, and hopefully double every user's money while they sleep
I am not sure open-sourcing of this is a good or bad idea, as it could be I am naive, so here are my thoughts:
- Bad idea:
- someone more familiar with big finance takes an optimal strategy stored here, and sells it to big finance making millions of dollars without me, ruining my return on investment
- some assumptions or code in this project could be fatally flawed, and someone decides to exploit it
- Neutral idea:
- a larger team takes the ambitions here, and makes the project happen without me — neutral return on investment, as I will still benefit from their result, even if my own investment was at a loss
- individuals and firms may not trust the project with their money, unless they too can inspect its operations, which open-source provides - however, they could just fork it, and setup their own product based off it, using their big brand name as leverage
- Good idea:
- someone more familiar with big finance notices the potential in the project, and reaches out to help make it happen, offering expertise and/or funding and/or team suggestions
- others also interested in this area help flesh this out, where one's expertise in one area compliments another's naiveity - this could be accomplished without open-source, but to do it without open-source, I'll need to hire people, of which, I'll need to find people to hire (first problem), and then to hire them (second problem)
- some assumptions or code in this project could be fatally flawed, and someone else can spot it before it becomes more of a liability
- the progress of strategies and implementation can be shared with support groups and other interested parties, to faciliate improvements and collaboration
INSTALL.md guide for how to setup this project yourself. Once there is a user-facing app, this will not be needed.
This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors, copyright holders, or Bevry be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
Use the software at your own risk. You are responsible for your own money. Past performance is not necessarily indicative of future results.
The authors and all affiliates assume no responsibility for your trading results.
Copyright (C) 2017+ Benjamin Lupton email@example.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Contributors certify their contributions adhere to the Developer Certificate or Origin.