OPEN-SOURCE SCRIPT

ComiCo - Joel on Crypto - MACD Scalping

Actualizado
This is a modified (hopefully improved) version of the "Joel on Crypto - MACD Scalping" indicator. It got turned into a strategy, and added some extra filters, like number of trades after EMA cross, minimal EMA distance (EMA 50's distance from the EMA 200). It is just an experiment to see how good this scalping strategy can get.

Play around with it and let me know if you found good settings, or just have a comment on it.


I could get fairly good results on BTCUSDT 5m with these settings (all others left on default values):

Ticks Avg. Multiplier = 1.4
Max trades after EMA cross = 16
Limit Price Difference = 0
Take Profit = 0.0065
Stop Loss = 0.0085
Min EMA difference = 110

Pyramiding = 3
Notas de prensa
Updated some inputs to be more meaningfull, expressed in %
New "best " values (based on deep backtest between 2019-01-01 and 2022-07-12) (all the other values left default):

Ticks Avg . Multiplier = 1.4
Max trades after EMA cross = 22
Limit Price Difference (%) = 0
Take Profit (%) = 0.65
Stop Loss (%) = 0.9
Min EMA difference (%) = 0.85

Pyramiding = 3
Notas de prensa
Added a new parameter: "Max. EMA difference" to limit value from the top as well. It was worth it.
I am doing deep backtesting from 2019-01-01 till today (2022-07-15) and the backtested profit seems to be not only comfortably high, but also fairly consistent throughout the years. Of course as a scalping strategy, it is very sensitive to broker fees. (And past results are no way a guarantee of future performance, of course:) )

I could reach good results with the following settings (all the other values left default):

Ticks Avg . Multiplier = 1.4
Max trades after EMA cross = 20
Limit Price Difference (%) (0-> market order) = 0
Take Profit (%) = 0.85
Stop Loss (%) = 1.1
Min. EMA difference (%) = 0.8
Max. EMA difference (%) = 3.1
Notas de prensa
Added controls to limit which signals to take as valid in case there are signals directly after each other.

I could reach good results with the following settings (all the other values left default):

Ticks Avg . Multiplier = 1.4
Max trades after EMA cross = 19
Act on the first N signal (min) = 1
Act on the first N signal (max) = 5
Limit Price Difference (%) (0-> market order) = 0
Take Profit (%) = 0.85
Stop Loss (%) = 1.25
Min. EMA difference (%) = 0.82
Max. EMA difference (%) = 3.1
Notas de prensa
Adapted the strategy to the aleeert service, a connector between trading view and binance.

Parameters are mostly the same, but here is a guide how to enter my tested parameters:
Change the following settings (all the other values left default):

Ticks Avg . Multiplier = 1.4
Max trades after EMA cross = 19
Act on the first N signal (min) = 1
Act on the first N signal (max) = 5
Limit Price Difference (%) (0-> market order) = 0
Take Profit (%) = 0.9
Stop Loss (%) = 1.3
Min. EMA difference (%) = 0.82
Max. EMA difference (%) = 3.1

Pyramiding = 20

the "ALEERT" section is for aleeert specific settings, you will probably get it if you got aleeert.

Of course ask if anything is unclear :)
Notas de prensa
minor typo corrections
Notas de prensa
Added a basic User's Guide, if you get lost any time, try to use it, hopefully it will help.
Notas de prensa
Chart and User's Guide updated.
Notas de prensa
Chart updated again.
Notas de prensa
Added a new Time Filter, so that you can restrict trading to weekdays, and to two time-periods.

Parameters are mostly the same, but here is a guide on how to enter my favourite parameters (your favourite may differ from these):
Apply the following settings (all the other values left default):

Symbol: BTCBUSD PERPETUAL FUTURES from Binance
Timezone: UTC-4
Timeframe: 5 min

Ticks Avg . Multiplier = 1.39
Max trades after EMA cross = 19
Act on the first N signal (min) = 1
Act on the first N signal (max) = 6
Limit Price Difference (%) (0-> market order) = 0
Take Profit (%) = 0.9
Stop Loss (%) = 1.3
Min. EMA difference (%) = 0.82
Max. EMA difference (%) = 3.1
Use Weekdays filter? = true
Weekdays to select: Mon, Tue, Wed, Thu, Fri
Use Session Filter = true
Time Period: 02:00-11:30
Use 2ND Session Filter = true
Time Period: 13:00-00:00

Pyramiding = 14

The "ALEERT" section is for aleeert specific settings, you will probably get it if you got aleeert.

Of course ask if anything is unclear :)

The User's Guide is updated as well.
Notas de prensa
Added a new option to be able to switch from EMA to SMA, DEMA, TEMA for determining the overall trend. I don't have the best settings for it, but go on and experiment with it :)

The values that need to be readjusted after changing a moving average method are at least the following:
Fast MA lenght
Slow MA lenght
Min. MA difference (%)
Max. MA difference (%)

The default value is still EMA, so all the old settings function like before.
Notas de prensa
Added another automated trading option, namely "TradingView To Anywhere" - mt4 version.
Added an economic news event effect avoidance option, where you can select which events to exclude from trading using an adjustable time window. These events had to be added to the source code, so it can only contain the latest news schedule available right now. It is "2022 Feb 02, 15:30 - Continuing Jobless Claims". After this event, the strategy will work like it worked before without "news effect avoidance". Of course I plan to give you an update before that date:)
The "best" values I concluded to with my backtestings are the actual default values.
Notas de prensa
There is an economic news event effect avoidance option, where you can select which events to exclude from trading using an adjustable time window by selecting the "true" or "false" values. These events had to be added to the source code, so it can only contain the latest news schedule available right now. It is "2023 Feb 28, 15:30 - Goods Trade Balance (Jan)". After this event, the strategy will work like it worked before without "news effect avoidance". Of course I plan to give you an update before that date:)
The "best" values I concluded to with my backtestings are the actual default values.
Notas de prensa
Fixed a bug in the News Avoidance module.
Notas de prensa
Economic calendar updated till the 14th of April 2023.
Notas de prensa
Fixed a problem on the aleeert automaiton side:
Rarely by closing the positions, a tiny portion was left open. Than if the stategy wanted to open an opposing direction position, aleeert gave an error, because of the position that was unintentionally left there. Now it is fixed by intentionally always closing the opposing direction position.
Notas de prensa
Added an extra time filter for Friday market close.
Notas de prensa
Added a dedicated time filter for Sundays.
Notas de prensa
Economic calendar updated till the 26th of May 2023.
Changed Sunday to be selected together with the active the Sunday filter.
Notas de prensa
It is a hotfix for the situation if the price moves so fast, that aleeert can't place the TP or SL, as the price is over the trigger price. Now with the fix whenever TradingView detects that a trade should be closed, a maket close is sent to aleeert. Than either the TP or SL order is executed, or the market close, whichever if faster. Most probably the TP or SL will be faster, but if for whatever reason it couldn't be placed, the market close kicks in.
Notas de prensa
Economic calendar updated till 2023.07.07.
Notas de prensa
- Added a way to limit how many trade groups can be traded after the EMA cross. Couldn't find a profitable way to use it, however just try it out :)
- Added trailing stop as well. The aleeert automated trading is adapted to it, but I never tested, be aware if you plan to use it. First it's better to play around with the settings. Be aware, that the trailing stop backtesting can return greatly differing results if you don't know what you do. Bar Magnifier is your friend in this case, but also be sure you understand how it works ;)
Notas de prensa
The economic news calendar was accidentally used from an older version. It got fixed now, the new last date of the economic calendar is 2023.07.07.
Please update to this version if you use the previous one. Otherwise the news effect avoidance won't work.
Notas de prensa
It should be a usual update of the economic calendar, but my source of the calendar website is not available, so I had to fabricate the next some events by hand. So, now we are only covered till the 18th of july 2023.
Notas de prensa
Economic calendar updated till 2023.09.14.
Notas de prensa
Added optional display for the actual TP and SL levels.
Notas de prensa
advanced the TP and SL display
Notas de prensa
Added experimental features - doesn't effect the normal operation.
Notas de prensa
Economic calendar updated until 2023.11.22.
Notas de prensa
Updated till the end on January 2024.
Exponential Moving Average (EMA)Moving Average Convergence / Divergence (MACD)Moving Averagestimefilter

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad