forexpirate

SMA for each time period

This script will plot a different SMA based on the time frame of the chart. I coded different SMAs for 1, 2, 15 mins, 1HR, and 1 Day. On the 1HR and 1Day time frame it plots a yellow SMA for the quarter of a year. I took the year to be 252 trading days per year and a quarter being 63 trading days.

* The blue and yellow bars are from two different scripts. The blue bars show when I am not available to trade. The yellow bars indicate Monday morning EST. I use them in considering trading ideas.
نص برمجي مفتوح المصدر

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

إخلاء المسؤولية

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

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//@version=2
study("SMA for each time period",overlay=true)
s = (period == "1"  ?144: period == "2"  ? 89: period == "15" ? 54:period == "60" ? 34:period == "D" ? 21:100)
f = (period == "1"  ?88: period == "2"  ? 54: period == "15" ? 34:period == "60" ? 21:period == "D" ? 13:100)
q = (period == "60" ? 1506:period == "D" ? 63:0)

plot(sma(close,f),color=aqua,linewidth=3,transp=0,title="Fast")
plot(sma(close,s),color=white,linewidth=3,transp=0,title="Slow")
plot(sma(close,q),color=yellow,linewidth=3,transp=0,title="Quarter")