You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### How can I plot a moving average when the chart's timeframe is 1D or higher?
1771
+
### How can I plot a moving average only when the chart's timeframe is 1D or higher?
1772
1772
1773
1773
We use ``f_chartTfInMinutes() >= 1440`` in here to test if the chart's timeframe is one day (1440 minutes) or greater. Our ``f_chartTfInMinutes()`` converts the chart's timeframe in minutes:
1774
1774
@@ -1793,7 +1793,7 @@ plot(plotMa ? ma : na)
1793
1793
1794
1794
### How can I plot a moving average calculated on the 1H timeframe on any chart?
1795
1795
1796
-
Here we plot the MA200 calculated at the 1H timeframe, but only when the chart's timeframe is lower or equal to 1H, otherwise it does make sense to calculate an MA at a lower timeframe than the chart's:
1796
+
Here we plot the MA200 calculated at the 1H timeframe, but only when the chart's timeframe is lower or equal to 1H, otherwise it doesn't make sense to calculate an MA at a lower timeframe than the chart's:
If you are OK with your script doing only that, this is a simpler method of achieving more or less the same result, without the bells and whistles of the previous example:
0 commit comments