Scalping using RSI 2 indicator with TSL

This strategy implements a simply scalping using the RSI (calculated on two periods), the slopes of two MAs ( EMA or SMA ) having different lengths (by default, I use 50 and 200).
A trailing stop loss (%) is used.

Entry conditions:
.) Fast MA > Slow MA and Price > Slow MA and RSI < Oversold Threshold ------> go Long
.) Fast MA < Slow MA and Price < Slow MA and RSI > Overbought Threshold ------> go Short

Exit conditions:
.) Long entry condition is true and (close >= TP or close <= TSL ) ----> close short position
.) Short entry condition is true and (close <= TP or close >= TSL ) ----> close long position

The strategy performed best on Bitcoin and the most liquid and capitalized Altcoins but works excellent on volatile assets, mainly if they often go trending.
Works best on 3h - 4h time frame.

There's also an optional Volatility filter, which opens the position only if the difference between the two slopes is more than a specific value, which can be set in the study inputs. The purpose is not opening positions if the price goes sideways and the noise is way > than the signal.

.) the RSI length is 2;
.) the oversold Threshold is 90%;
.) the overbought Threshold is 10%;
.) by default, the trailing stop loss per cent is 1%;
.) by default, the fast MA length is 50;
.) by default, the slow MA length is 200;
.) by default, the MA used is EMA .

ملاحظات الأخبار: Added the alerts.
ملاحظات الأخبار: A new version of this scalping strategy uses the RSI indicator.

I have improved the exit conditions in this version, and I implemented the alters using the alert() function.

Now, the alters can inform you correctly about every entry and exit conditions.
ملاحظات الأخبار: Modified the comments.
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟


Hi, total newbie here, been reading here and there and your work is impressive, little question though, you mentioned it works best on 3-4hr timeframe, is there a significant difference with smaller timeframes, say 1hr? Many thanks!
Ninorigo Brosz93
@Brosz93, Hi, you can choose the timeframe you want; however, you have to consider these two factors when choosing:
1) the fees
2) the max drawdown.
Therefore, the timeframe of 3h-4h is the right compromise in the BTC / USDT pair.
Good job ! I like your work, but in live trading this wil not work "I think". In the backtest we can't see if price movement will hit the profit target or the stop loss first.
Tradingview data doesn't show what price movement did inside the candle.
@VGNOMICS, Right. I am thinking of how to bypass this TradingView "feature".
The ideal would be to intercept when the strategy.exit command is executed to trigger the alert.

Do you have any suggestions?
@Ninorigo, No, we don't think it is possible to bypass this, Tradingview doesn't have the data. We made a similar scalping bot, it gave great results while backtesting, but once we started forward testing price was most of the time hitting our stop loss target first.

If you find a solution, let me know my friend.
Thumbs up for your work !
@VGNOMICS, Hi, my friend.
In this latest version of the strategy, I have changed the management of the alarms, and it is actually possible to intercept the execution of the "strategy.exit" function.
You need to create an "alert's notification message" using the control panel and enter the core corresponding placeholder.
navyreal7 Ninorigo
@Ninorigo, for this you can consider a script from the quantum nomad "Trailing QN" ... I also have an idea to implement risk management with the help of it. but i'm not a programmer
Ninorigo navyreal7
@navyreal7, Tell me everything. If you want, send me a message about your idea of risk management.
I don't quite understand what you mean by "Trailing QN". Could you please explain it to me?
الصفحة الرئيسية منصة الأسهم منصًة العملات منصّة العملات الرقمية جدول الأعمال الاقتصادي حول مميزات الرسم البياني أسعار العضوية إحالة صديق قوانين الموقع مركز المساعدة حلول المواقع الإلكترونية والوسطاء الأدوات حلول الرسوم البيانية مكتبة الرسوم البيانية صغيرة الحجم المدوّنة والأخبار تويتر
ملف التعريف إعدادات الصفحة الشخصية الحساب وإعداد الفواتير الأصدقاء المُحالون العملات الافتراضية تذاكر الدعم الخاصة بي مركز المساعدة رسالة خاصة المحادثة تسجيل الخروج