Bollinger Band strategy with split, limit, stopEntering a short position after breaking the upper Bollinger Band, entering a long position when entering after breaking the lower Bollinger Band
Provides templates for how to display position average price, stop loss, and profit price using the plot function on the chart, and how to buy splits
After entering the position, if the price crosses the mid-band line, the stop loss is adjusted to the mid-band line.
Limit
BollingerBands Strat + pending order alerts via TradingConnectorSoftware part of algotrading is simpler than you think. TradingView is a great place to do this actually. To present it, I'm publishing each of the default strategies you can find in Pinescript editor's "built-in" list with slight modification - I'm only adding 2 lines of code, which will trigger alerts, ready to be forwarded to your broker via TradingConnector and instantly executed there. Alerts added in this script: 14, 17, 20 and 23.
SCRIPT INCLUDES PENDING ORDERS AND ALERTS! Alert will be sent to MetaTrader when order is triggered, but not yet filled. That means if market conditions change and order does not get filled, it needs to be cancelled as well, and there are alerts for that in the script as well.
How it works:
1. TradingView alert fires.
2. TradingConnector catches it and forwards to MetaTrader4/5 you got from your broker.
3. Trade gets executed inside MetaTrader within 1 second of fired alert.
When configuring alert, make sure to select "alert() function calls only" in CreateAlert popup. One alert per ticker is required.
Adding stop-loss, take-profit, trailing-stop, break-even or executing pending orders is also possible. These topics have been covered in other example posts.
This routing works for Forex, indices, stocks, crypto - anything your broker offers via their MetaTrader4 or 5.
Disclaimer: This concept is presented for educational purposes only. Profitable results of trading this strategy are not guaranteed even if the backtest suggests so. By no means this post can be considered a trading advice. You trade at your own risk.
If you are thinking to execute this particular strategy, make sure to find the instrument, settings and timeframe which you like most. You can do this by your own research only.
Automated - Fibs with Limit only ordersAutomated - Fibs with Limit only orders
This script was designed to demonstrate how you can use a single alert to move your limit orders around.
It is not meant to be traded live and has been built to work with Binance Futures Testnet.
You will notice a lot of plots with 5 different titles.
New = Place your limit buy at a fixed-price.
Move = Cancel the current limit buy and place it at the new fixed-price.
Filled = Cancel any limit closes and places them anew based on the new average and take profit.
Cancel = Cancels exisiting limit buys.
Cloes All = Limit close filled, no commands necessary.
The default quantity in the command is the minimum order size on Binance.
Settings
Live
- If enabled it will only place trades after the "Stat Timestamp + Start Delay" that you provide.
Start Timestamp
- Use something similar to epochconverter to get the current timestamp.
Start Delay
- Gives you 1 minute by default to start the script and create your alert before it begins looking for a new entry.
Leverage
- Default 1. Affects the "Take Profit and DCA When" Settings.
Take Profit %
- This is the percentage above the current average you'd like to place your position close at.
DCA When %
- The percentage below your last entry that you're willing to buy again.
Note: This strategy has no stop-loss and pyramiding is enabled. It is not built for, or recommended to run live.
I hope this opens some doors and helps advance your personal trading system.
Good luck and happy scripting!
Strategy Code Example 2 - Time Limiting*** THIS IS JUST AN EXAMPLE OF STRATEGY TIME LIMITING CODE IMPLEMENTATION ***
This is a follow up to my example for risk management implementation here:
Code remains mostly unchanged, but now includes a time limiting implementation.
Relevant code blocks for the time factor are preceded with a comment stating:
*** FOCUS OF EXAMPLE ***
Cheers!