Customizable Non-Repainting HTF MACD MFI Scalper Bot Strategy

MauricioZuniga Diupdate   
This script was originally shared by Wunderbit as a free open source script for the community to work with.

It is intended for use on an algorithmic bot trading platform but can be used for scalping and manual trading.
This strategy is based on the trend-following momentum indicator . It includes the Money Flow index as an additional point for entry.

It uses a combination of MACD and MFI indicators to create entry signals. Parameters for each indicator have been surfaced for user configurability.
Take profits are fixed, but stop loss uses ATR configuration to minimize losses and close profitably.

I started trying to deploy this script myself in my algorithmic trading but ran into some issues which I have tried to address in this version.
  • Delayed Signals : The script has been refactored to use a time frame drop down. The higher time frame can be run on a faster chart (recommended on one minute chart for fastest signal confirmation and relay to algotrading platform.)
  • Repainting Issues : All indicators have been recoded to use the security function that checks to see if the current calculation is in realtime, if it is, then it uses the previous bar for calculation. If you are still experiencing repainting issues based on intended (or non intended use), please provide a report with screenshot and explanation so I can try to address.
  • Filtering : I have added to additional filters an ABOVE EMA Filter and a BELOW RSI Filter (both can be turned on and off)
  • Customizable Long and Close Messages : This allows someone to use the script for algorithmic trading without having to alter code. It also means you can use one indicator for all of your different alterts required for your bots.

It is intended to be used in the 5-30 minute time frames, but you might be able to get a good configuration for higher time frames. I welcome feedback from other users on what they have found.

Find a pair with high volatility (example ETHUSDT.3L ) - I have found it works particularly well with 3L and 3S tokens for crypto. although it the limitation is that confrigurations I have found to work typically have low R/R ratio, but very high win rate and profit factor.

Ideally set one minute chart for bots, but you can use other charts for manual trading. The signal will be delayed by one bar but I have found configurations that still test well.
Select a time frame in configuration for your indicator calculations.

Select the strategy config for time frame. I like to use 5 and 15 minutes for scalping scenarios, but I am interested in hearing back from other community memebers.

Optimize your indicator without filters (trendFilter and RSI Filter)

Use the TrendFilter and RSI Filter to further refine your signals for entry. You will get less entries but you can increase your win ratio.

I will add screenshots and possibly a video provided that it passes community standards.

Limitations: this works rather well for short term, and does some good forward testing but back testing large data sets is a problem when switching from very small time frame to large time frame. For instance, finding a configuration that works on a one minute chart but then changing to a 1 hour chart means you lose some of your intra bar calclulations. There are some new features in pine script which might be able to address, this, but I have not had a chance to work on that issue.
Catatan Rilis:
Updated code comments
Catatan Rilis:
Added a comment filed for closing trailing stop so that strategy can be automated on both opens and closes. Previously the strategy was dependent on having subsystem closing order based on parameters set there. This can yield much better returns on backtest.
Catatan Rilis:
Add option to add or remove Take Profit 1 as the trailing stop can perform better without it.

Reformatted the config interface for easier input and changed the default parameters to ones that are working for certain pairs to see if they work on others.

I found that using an RSI filter for below 60 period @ 38 through 40 length worked well on 5 minute chart to filter out some losing trades and increase profitability.

Skrip open-source

Dalam semangat TradingView, penulis dari skrip ini telah mempublikasikannya ke sumber-terbuka, maka trader dapat mengerti dan memverifikasinya. Semangat untuk penulis! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.

Inggin menggunakan skrip ini pada chart?