工作已完成
指定
i need a custom indicator in mql5 syntax with arrows to point when to buy or sell at time frames M5 and M15. the bellow settings and criteria look into higher time frames to confirm entries. I need extra string to add symbols:
input string symbol2 = "DXY"; input string symbol3 = "US10Y";
i have made a very basic sketch on chatgpt but it needs professional code work.
Indicators and Settings Used:
- Commodity Channel Index (CCI)
- Two instances of CCI with different periods.
- ccihandle: CCI on the main timeframe (tf) with period ccip (default 140).
- ccihandle2: CCI on another timeframe (tfb) with period ccip2 (default 30).
- Moving Average (MA)
- mahandle: Linear Weighted Moving Average (LWMA) on PERIOD_M15 with period map (default 140).
- _mahandle and _mahandle2: Smoothed Moving Average (SMMA) on PERIOD_M6 with periods 60 and 76 respectively applied to OBV.
- Standard Deviation (StdDev)
- stdhandle: Standard Deviation on PERIOD_M15 with period map (default 140).
- Relative Strength Index (RSI)
- rsihandle2: RSI on PERIOD_H2 with period 14.
- rsihandle3: RSI on PERIOD_D1 with period 14.
- On-Balance Volume (OBV)
- mfihandle: OBV on PERIOD_M6.
- _mahandle and _mahandle2: SMMA applied to OBV with periods 60 and 76 respectively.
- Average True Range (ATR)
- atrhandle: ATR on PERIOD_M6 with period 14.
Buy and Sell Entry Criteria:
Buy Entry Conditions:
- CCI-based Trend:
- Buy trend is determined if the closing price does not exceed the high of the previous r bars on the main timeframe (tf).
- Another buy trend is determined similarly but on a different timeframe (tf4) with r2 bars.
- RSI-based Cycle:
- Buy cycle is initiated if the RSI value on PERIOD_D1 crosses above 35 from below.
- Daily Change-based Trend:
- Buy trend is set if the daily change of "EURUSD" on PERIOD_H12 is greater than 0.5.
- Buy trend is set if the daily change of sym2 is greater than the daily change of _Symbol by at least 0.1.
- Buy trend is set if the daily change of sym3 is less than the daily change of _Symbol by at least 0.01.
- Combination of Conditions:
- Buy entry occurs when the following conditions are met:
- RSI2 is less than 70.
- There are no conflicting sell signals.
Sell Entry Conditions:
- CCI-based Trend:
- Sell trend is determined if the closing price does not fall below the low of the previous r bars on the main timeframe (tf).
- Another sell trend is determined similarly but on a different timeframe (tf4) with r2 bars.
- RSI-based Cycle:
- Sell cycle is initiated if the RSI value on PERIOD_D1 crosses below 69 from above.
- Daily Change-based Trend:
- Sell trend is set if the daily change of "EURUSD" on PERIOD_H12 is less than -0.5.
- Sell trend is set if the daily change of sym2 is less than the daily change of _Symbol by at least 0.1.
- Sell trend is set if the daily change of sym3 is greater than the daily change of _Symbol by at least 0.01.
- Combination of Conditions:
- Sell entry occurs when the following conditions are met:
- RSI2 is greater than 30.
- There are no conflicting buy signals.
Additional Indicators:
5. Moving Average Convergence Divergence (MACD): This can help to confirm the trend direction and momentum.
§ MACD Line: Difference between the 12-period and 26-period EMA.
§ Signal Line: 9-period EMA of the MACD Line.
§ Entry Criteria: Buy when the MACD Line crosses above the Signal Line, and sell when it crosses below.
6. Bollinger Bands: These can be used to identify overbought and oversold conditions.
§ Entry Criteria: Buy when the price touches the lower band, and sell when it touches the upper band.
7. Volume: Volume indicators can confirm the strength of a price move.
§ On-Balance Volume (OBV): Used to detect trend direction.
§ Entry Criteria: Confirm buy signals with increasing volume and sell signals with decreasing volume.
8. Fibonacci Retracement Levels: These can be used to identify potential support and resistance levels.
§ Entry Criteria: Buy near the 38.2%, 50%, or 61.8% retracement levels during an uptrend and sell near these levels during a downtrend.
9. Parabolic SAR: This can help to determine the direction of the trend and potential reversal points.
§ Entry Criteria: Buy when the Parabolic SAR moves below the price, and sell when it moves above the price.