Scripting Tutorial A - TManyMA - StopsThis script is for a triple moving average strategy where the user can select from different types of moving averages, price sources, lookback periods and resolutions.
Features:
- 3 Moving Averages with variable MA types, periods, price sources, resolutions and the ability to disable each individually.
- Crossovers are plotted on the chart with detailed information regarding the crossover (Ex: 50 SMA crossed over 200 SMA )
- Forecasting available for all three MAs. MA values are forecasted 5 values out and plotted as if a continuation to the MA.
- Forecast bias also applies to all forecasting. Bias means we can forecast based on an anticipated bullish, bearish or neutral direction in the market.
- To understand bias, please read the source code, or if you can't read the code just send me a message on here or Twitter. Twitter should be linked to my profile.
- Ribbons added and on by default. Optional setting to disable the ribbons. 5 ribbons between MA1 and MA2 and another 5 between MA2 and MA3.
- Ribbons are alpha-color coded based on their relation to their default MAs.
- Ribbons are only visible between MAs if the MAs being compared share the same Type, Resolution, and Source because there is no way to consolidate those three in a simple manner.
- Ribbon values are calculated based on calculated MA Periods between the MAs.
- Converted the existing study into a strategy.
- Strategy only enters long positions with a market order when MA crossovers occur.
- Strategy exits positions when crossunders occur.
- Trades 100% of the equity with one order/position by default.
- Ability to disable trading certain crosses with input checks.
- Ability to exit trades with a take profit or stop loss.
- User input to allow quick changes to the take profit or stop loss percentages.
This script is meant as an educational script with well-formatted styling, and references for specific functions.
*** PLEASE NOTE - THIS STRATEGY IS MEANT FOR LEARNING PURPOSES. DEPENDING ON IT'S CONFIGURATION IT MAY OR MAY NOT BE USEFUL FOR ACTUAL TRADING. THE STRATEGY IS NOT FINANCIAL ADVICE ***
Stop-loss
Hendo's Volatillity Stop HelperA simple indicator helping you with stop loss placement. It uses the recent volatility in the market to generate a band above and below price.
If you struggle with stop loss placement but already understand entries, exits and direction this indicator might be one for you.
Pairs extremely well with certain oscillators, price action trading and pivot point trading.
Comes with 8 settings to facilitate both types of traders:
High acuraccy, low risk/reward ratio
Low acuraccy, high risk/reward ratio
Colours & Transparancy are fully customizable. Access is free, source code is protected and will remain to be so.
In order to achieve the best results I highly suggest you to place stop losses below the lower band (in longs) and above the upper band (in shorts).
Stay tuned for more!
ATR ChannelsATR Channels help you to identify where to place your stop-loss or trailing stop-loss based on price volatility, according to the Average True Range (ATR).
NeoIchi TrailingThis is the separation of moving average parts from NeoIchi indicator with addition of four different ATR setting that can be used for Stop Loss and Trailing Stops. The NeoIchi indicator won't have any moving averages any more, the code is secured but every one have access to use this indicator on their charts.
Ehlers Instantaneous Trendline StrategyInstantaneous Trendline Strategy by John Ehlers from his book "Cybernetic Analysis for Stocks and Futures".
You can choose implementation of stop-loss. Don't forget to define correct spread for your instrument.
Double EMA with stop loss indicatorThis is an updated version of my previous stop loss script.
I've added a double EMA line and modified the stop as below;
In an uptrend....
1. a yellow dot will appear once it's time to move your stop. The yellow dot will display at the level of the stop loss. Place your stop 1 pip below the dot.
2. The yellow dot will only appear if a new higher low has formed and has been confirmed. Also the current candle must have broken the high of a previous bullish candle or the dot will not appear.
3. The dot will also appear if there is a likely reversal of the current trend.
Also works in downtrends.....
Binque's Stop Loss IndicatorBinque's Stop Loss Indicator is a great way to visualize a trailing stop loss based on a percent from the high. i.e. If the high was $10 of a trading day and your stop loss was set at 5% (percent) then your chart would show a small dot 5% below the high of the day. This is a great way to quickly see a trailing stock idea. Change the color to match your back ground. Adjust your trailing stop loss to fit your trading style.
Note: This indicator is calculated off of the daily high.
XPloRR MA-Buy ATR-Trailing-Stop Long Term Strategy Beating B&HXPloRR MA-Buy ATR-MA-Trailing-Stop Strategy
Long term MA Trailing Stop strategy to beat Buy&Hold strategy
None of the strategies that I tested can beat the long term Buy&Hold strategy. That's the reason why I wrote this strategy.
Purpose: beat Buy&Hold strategy with around 10 trades. 100% capitalize sold trade into new trade.
My buy strategy is triggered by the EMA(blue) crossing over the SMA curve(orange).
My sell strategy is triggered by another EMA(lime) of the close value crossing the trailing stop(green) value.
The trailing stop value(green) is set to a multiple of the ATR(15) value.
ATR(15) is the SMA(15) value of the difference between high and low values.
Every stock has it's own "DNA", so first thing to do is find the right parameters to get the best strategy values voor EMA, SMA and Trailing Stop.
Then keep using these parameter for future buy/sell signals only for that particular stock.
Do the same for other stocks.
Here are the parameters:
Exponential MA: buy trigger when crossing over the SMA value (use values between 11-50)
Simple MA: buy trigger when EMA crosses over the SMA value (use values between 20 and 200)
Stop EMA: sell trigger when Stop EMA of close value crosses under the trailing stop value (use values between 8 and 16)
Trailing Stop #ATR: defines the trailing stop value as a multiple of the ATR(15) value
Example parameters for different stocks (Start capital: 1000, Order=100% of equity, Period 1/1/2005 to now):
BAR(Barco): EMA=11, SMA=82, StopEMA=12, Stop#ATR=9
Buy&HoldProfit: 45.82%, NetProfit: 294.7%, #Trades:8, %Profit:62.5%, ProfitFactor: 12.539
AAPL(Apple): EMA=12, SMA=45, StopEMA=12, Stop#ATR=6
Buy&HoldProfit: 2925.86%, NetProfit: 4035.92%, #Trades:10, %Profit:60%, ProfitFactor: 6.36
BEKB(Bekaert): EMA=12, SMA=42, StopEMA=12, Stop#ATR=7
Buy&HoldProfit: 81.11%, NetProfit: 521.37%, #Trades:10, %Profit:60%, ProfitFactor: 2.617
SOLB(Solvay): EMA=12, SMA=63, StopEMA=11, Stop#ATR=8
Buy&HoldProfit: 43.61%, NetProfit: 151.4%, #Trades:8, %Profit:75%, ProfitFactor: 3.794
PHIA(Philips): EMA=11, SMA=80, StopEMA=8, Stop#ATR=10
Buy&HoldProfit: 56.79%, NetProfit: 198.46%, #Trades:6, %Profit:83.33%, ProfitFactor: 23.07
I am very curious to see the parameters for your stocks and please make suggestions to improve this strategy.
ATR+ (Stop Loss Indicator)This script is designed to aid in back-testing and trade execution.
It displays three sets of values - the teal colored value is the current ATR, the green colored value is your stop loss distance (in pips) below the most recent swing low for long trades , and the red colored value is your stop loss distance (in pips) above the most recent swing high for short trades .
You can change the stop loss settings to base your stop loss on a set pip amount or by however many multiples of the current ATR as you wish (eg. 1.5x ATR).
Feel free to ask any questions or edit the script without permission :)
- Matt.