ikoskela

EMA Mega Cross Strategy

ikoskela Uppdaterad   
Based on Anvamsi's script which uses 12/26 EMA crosses for entry/exit signals. I also add the following features:
* Optimized default parameters for ETH 4hr chart
* Use EMA 55/200 relationship to filter out signals
* Use RSI vs EMA of RSI to filter out signals
* Use 26/55 EMA relationship to filter out signals
* Use volume climax technique as an additional exit strategy
* Uses bull/bear RSI divs as an additional exit strategy
* Adds bull RSI div quick flip plays when nothing else is going on for extra $$

This very experimental and my first major script. I've kept it invite only because the only people using this should have a direct line of communication open with me at this point.

NOTE #1:
You can get 2018 ETH trade profitability to reach 100% if you change line 97 from:
if (shortEMA and (rsi1 <= ema(rsi1,RSIEMALength)) and shorttrend and (ema(close,26) < ema(close,55)))
to:
if (shortEMA and (rsi1 <= ema(rsi1,RSIEMALength)) and shorttrend)

Basically, you remove an extra filter from the short strategy. It's novel to see profitability hit 100% but if you look at performance from 2017, it increases the max draw down by a lot!

NOTE #2:
I couldn't get RSI bear div quick flips to work so they are disabled. The remaining short strategy is in effect.

NOTE #3:
The profitability is good for long-only, if you check Strategy Tester->Performance Summary.

NOTE #4:
I am not an expert trader (mainly due to psychological factors i think) but i can program and have a good understanding of signal processing from working with analog synthesizers. Use this at your own risk. I am not liable if you lose all of your money!

NOTE #5:
Code is really messy. Old code commented out everywhere. :/
Versionsinformation:
THIS IS A MORE CONSERVATIVE VERSION.

I removed the RSI div parts of the code because I am not confident in them yet. They backtest OK but what happens in real-life is that the RSI get pulled to the extreme in real-time and then subsequent candles mellow it out as the trend reverses. This means that, in practice, you may get buy/sell signals that then disappear later on!

I've left some RSI-based elements in the code to filter out EMA crosses that shouldn't be taken on at the RSI extremes. I'm more comfortable using RSI to prevent a trade.

I've also left in the climax oversold/overbought alerts, which do use RSI since I do know historically that they work well.

I am going to further refine the RSI div part of the code later on so it will return. In the meantime, I would just use this script in conjunction with an RSI div script so you can use it with your own judgement manually.
Versionsinformation:
Added the following checkboxes to the settings menu:

UseShorting = input(true,"Enable Shorting")
UseStopEntry = input(true,"After Entry Signal, Use Stop to Enter on HH(LL)")
UseStopExit = input(false,"After Exit Signal, Use Stop to Exit on LL(HH)")
UseVolumeClimax = input(false,"Immediately exit when Volume Climax is detected")
Versionsinformation:
I couldn't get the stop entries to work correctly so I switched the option to choose whether HH(LL) should accompany the entry and exit signal when triggering a market order.
Versionsinformation:
I've added an exception to the EMA26/55 rule that allows long entries if the daily RSI has gone below a certain threshold and certain number of candles back, AND the 26/55 MACD is above a certain threshold. I have it set at -23. You should experiment with this to catch long entries after bottoms and whether or not loosening the criteria to catch them positively or negatively impacts the trade strategy.

I've also cleaned up the code and commented it.
Endast inbjudanskript.

Tillgången till detta skript är begränsat till användare som har godkänts av författaren och kräver vanligtvis betalning. Du kan lägga till det till dina favoriter men du kan bara använda det efter att ha begärt och fått författarens tillstånd. Kontakta ikoskela för mer information eller följ författarens instruktioner här under.

TradingView rekommenderar inte att du betalar för ett skript och använder det om du inte litar till 100% på författaren och förstår hur skriptet fungerar. I många fall kan du hitta ett bra alternativ med öppen källkod gratis i våra Community skripts .

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?

Varning:Var god läs innan du begär åtkomst.