I wanted to modify this code found on earnforex so that it gives me alerts on MT4 when the following condition is encountered:
Receive an alert when 2 heiken ashi candles of the same color follow a heiken ashi candle of a different color.
I thought that with this code as a starting point Chatgpt would do this for me easily. But no, after several attempts I've cracked and come here to ask for help.
If any member has a clue as to how I can code my little indicator, I'd love to hear from you.
Thanks in advance to anyone who can help.
here is the sample code:
Code: Select all
*/
//-PROPERTIES-//
//Properties help the software look better when you load it in MT4
//Provide more information and details
//This is what you see in the About tab when you load an Indicator or an Expert Advisor
#property link "https://www.earnforex.com/metatrader-indicators/alert-indicator-template/"
#property version "1.0"
#property strict
#property copyright "EarnForex.com - 2019-2021"
#property description "Alert Indicator Template"
#property description "So You Can Create Your Own Indicator And Alerts"
#property description " "
#property description "WARNING : You use this software at your own risk."
#property description "The creator of these plugins cannot be held responsible for any damage or loss."
#property description " "
#property description "Find More on EarnForex.com"
//You can set an icon for the indicator to show when loading it on chart
//Icon must have an ico extension and be located in the MQL4/Files folder, the following commented line is an example of icon
#property icon "\\Files\\EF-Icon-64x64px.ico"
//-INPUT PARAMETERS-//
//The input parameters are the ones that can be set by the user when launching the Indicator
//If you place a comment following the input variable this will be shown as description of the field
input string Comment1="========================"; //MQLTA Alert Indicator Template
input string IndicatorName="MQLTA-AIT"; //Indicator Short Name
input string Comment2="========================"; //Indicator Parameters
//This is likely the only section you need to edit to adapt the indicator to your goal
//For example if you are using RSI in you indicator you can add here the input for the period and the relevant levels
input ENUM_CANDLE_TO_CHECK CandleToCheck=CURRENT_CANDLE; //Candle To Use For Analysis
input int BarsToScan=500; //Number Of Candles To Analyse
input string Comment_3="===================="; //Notification Options
input bool EnableNotify=false; //Enable Notifications Feature
input bool SendAlert=true; //Send Alert Notification
input bool SendApp=true; //Send Notification to Mobile
input bool SendEmail=true; //Send Notification via Email
input int WaitTimeNotify=5; //Wait time between notifications (Minutes)
//Arrow Style can be chosen between Wingdings and preset arrows, see following URLs for all the codes
//https://docs.mql4.com/constants/objectconstants/wingdings
//https://docs.mql4.com/constants/objectconstants/arrows
input string Comment_4="===================="; //Buffers Options
input int ArrowTypeBuy=241; //Code For Buy Arrow
input int ArrowTypeSell=242; //Code For Sell Arrow
input bool ArrowShowNeutral=false; //Show Stop Arrow
input int ArrowTypeStop=251; //Code For Stop Arrow
input color ArrowColorBuy=clrGreen; //Color For Buy Arrow
input color ArrowColorSell=clrRed; //Color For Sell Arrow
input color ArrowColorStop=clrGray; //Color For Stop Arrow
input ENUM_CANDLE_SIZE ArrowSize=CANDLE_SIZE_MEDIUM; //Size Of The Arrows
input ENUM_CANDLE_DISTANCE CandleDistance=CANDLE_DISTANCE_NEAR; //Arrow Distance From Candle