Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Pivot Points with Adjustable Closing Time - MetaTrader 4 Script | Trading Script Download - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

Pivot Point with adjustable closing time - indicator for MetaTrader 4

Pivot Point with adjustable closing time - indicator for MetaTrader 4

Pivot Point with adjustable closing time - indicator for MetaTrader 4

Pivot Point with adjustable closing time - indicator for MetaTrader 4

Pivot Point with adjustable closing time - indicator for MetaTrader 4

Daily (weekly, monthly) level PP indicator for time ranges smaller than daily . I will skip the part that discusses its basic use in trading, you can find that information here: https://en.wikipedia.org/wiki/Pivot_point_(Technical Analysis)

Customized deviation from ordinary PP indicators:

This indicator shows daily PP, which is calculated based on the closing price of the adjustable hourly bar of the previous trading day. This is useful if, for example, you want to get the closing price in New York, rather than the rather intentional closing price where you live or where your broker operates. The original setup is designed for the UTC time zone.

A particular challenge was the Sunday bar provided by my agent. They are eliminated in this indicator and displayed in the same way as on Monday.

Often, weekly and monthly PP provide additional hints for technical analysis. They can therefore also be displayed (see corresponding input variables). You can also display the midpoint of the day.

To achieve these premises, PP is calculated differently on Mondays and Sundays. So the calculation determines the TimeDayOfWeek in the switch and the formulas are slightly different from each other as needed. The trick used (I'm not sure if it's smart) is to determine the actual number of bars in the hourly timeframe (variable hshift) until the start of the day. For this hourly shift, it is necessary to add the amount required for the hourly bar shift to obtain the bar of interest, whose closing time is used in the PP calculation.

Pivot Point with adjustable closing time - indicator for MetaTrader 4

This indicator has an important limitation:

I think the code review is fair and look forward to your kind criticism to improve the metrics. If you like it, please rate the metric in the code base and recommend it to your friends!


Attachment download

📎 pivotpoints.mq4 (21.79 KB)

📎 pp.mq4 (23.19 KB)

Source: MQL5 #12953

Verification code Refresh