OrionAlgo

Fear N Greed

Overview
The goal of this script was to apply the concept of Herd Mentality. While one voice may seem unique, when you combine all the voices together they average out and show an overall emotion of the herd. We should be able to apply this concept to indicators, giving us the Fear and Greed of the markets.

How to Use
Buy when there is fear and sell when there is greed. Pay attention to changes in direction of the indicator. If the data is fearful and the data is starting to change direction, it signals that it's probably a good time to buy because greed is slowly starting to enter the market. You can use this indicator in any time frame, just check the past data to determine how useful it will be for that specific period.

Options
  • Smoothing : This will smooth the data. Try to stay around 5-15. High values will cause the indicator to lag
  • Line Width : Visually changes the width of the data line
  • Top Band +- : Moves the top band up or down
  • Bot Band +- : Moves the bottom band up or down
  • Mid Band Width : Adjusts the width of the middle region
  • Fear Alert Level >= : Sets when the alert will start to trigger
  • Greed Alert Level >= : Sets when the alert will start to trigger

Indicators
There are multiple indicators used in this script. I used the Stochastic RSI to measure strength in the market. This combines well with the MACD indicator by giving you really good entry and exit points. There is an indicator combining money flow and rate of return to give a basic emotion of the data. I also included breadth and momentum and several others to help gauge the direction of the market. I then normalize all of the indicators between 0-100 so that I can get an overall average, smooth the noise, and ultimately plot the data.

Bands
While making this script I noticed flowing regions of the data that would act as support and resistance so I did my best to calculate where they might fall. I essentially take the high and low data points from various lengths averaging them and then apply a smoothing filter to the band. I then noticed that between the bands there was a significant region that acted as a middle resistance and support. I decided the best way to make this region was to take the average high + average low of the data and divide it by 2 to get the center region. The reason I did this instead of just using the mid point of the bands was because when the data stays in a similar region it creates resistance, so it's more accurate to base the mid point on a shorter time frame rather than the overall bands of higher timeframes.

Alerts
Alerts are set up based on the change in data direction. If you set Fear as the alert for Fear Alert >= it will wait for a change in direction if the data is greater than or equal to the selected Fear level.
When setting alerts, make sure to use Once Per Bar Close as the option. There are 3 alert types: Fear Alert, Greed Alert, and Fear and Greed Alert. Fear and Greed Alert will combine the alerts into one message so that it's usable for free accounts. Fear Alert and Greed Alert will only message for those specific positions.

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

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

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