LucasVivien

Stochastic Moving Average

LucasVivien 已更新   
Hi all,

This Strategy script combines the power of EMAs along with the Stochastic Oscillator in a trend following / continuation manner, along with some cool functionalities.
I designed this script especially for trading altcoins, but it works just as good on Bitcoin itself and on some Forex pairs.

______ SIGNALS ______

The script has 4 mandatory conditions to unlock a trading signal. Find these conditions for a long trade below (works the exact other way round for shorts)
- Fast EMA must be higher than Slow EMA
- Stochastic K% line must be in oversold territory
- Stochastic K% line must cross over Stochastic D% line
- Price as to close between slow EMA and fast EMA
Once all the conditions are true, a trade will start at the opening of the next

______ SETTINGS ______

- Trade Setup:
Here you can choose to trade only longs or shorts and change your Risk:Reward.
You can also decide to adjust your volume per position according to your risk tolerance. With “% of Equity” your stop loss will always be equal to a fixed percentage of your initial capital (will “compound” overtime) and with “$ Amount” your stop loss will always be 'x' amount of the base currency (ex: USD, will not compound)
Stop Loss:
The ATR is used to create a stop loss that matches current volatility. The multiplier corresponds to how many times the ATR stop losses and take profits will be away from closing price.

- Stochastic:
Here you can find the usual K% & D% length and overbought (OB) and oversold (OS) levels.
The “Stochastic OB/OS lookback” increase the tolerance towards OB/OS territories. It allows to look 'x' bars back for a value of the Stochastic K line to be overbought or oversold when detecting an entry signal.
The “All must be OB/OS” refers to the previous “Stochastic OB/OS lookback” parameter. If this option is ticked, instead of needing only 1 OB/OS value within the lookback period to get a valid signal, now, all bars looked back must be OB/OS.
The color gradient drawn between the fast and slow EMAs is a representation of the Stochastic K% line position. With default setting colors, when fast EMA > slow EMA, gradient will become solid blue when Stochastic is oversold and when slow EMA > fast EMA, gradient will become solid blue when Stochastic is overbought

- EMAs:
Just pick your favorite ones

- Reference Market:
An additional filter to be certain to stay aligned with the current a market index trend (in our case: Bitcoin). If selected reference market (and timeframe) is trading above selected EMA, this strategy will only take long trades (vice-versa for shorts) Because, let’s face it… even if this filter isn’t bulletproof, you know for sure that when Bitcoin tanks, there won’t be many Alts going north simultaneously. Once again, this is a trend following strategy.

A few tips for increased performance: fast EMA and D% Line can be real fast… 😉

As always, my scripts evolve greatly with your ideas and suggestions, keep them coming! I will gladly incorporate more functionalities as I go.
All my script are tradable when published but remain work in progress, looking for further improvements.


Hope you like it!
版本注释:
Updated default settings
版本注释:
Alerts() functions added for:
- Long trade start
- Short trade start
- Long stop or target activated
- Long stop or target activated

User input added for alert messages
This was designed in order for 3Commas users to simply copy/paste the "Messages" of their bots using TradingView custom signals.
Otherwise, you can input any message you like!

Feel free to get in touch with me if you want help setting up trading automation with 3Commas :)
版本注释:
Typo in settings menu fixed

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?