My MQL skills is too limited so please help and advice.
My EA uses EachTick as a signal mode.
There're always Three predefined zones as following:
double Level_CC = Close[0]; // The current pricedouble Level_HH, Level_HL; // Calculated limits of the higher zone (ZoneH)double Level_MH, Level_ML; // Calculated limits of the middle zone (ZoneM)double Level_LH, Level_LL; // Calculated limits of the lower zone (ZoneL)bool ZoneH = (Level_HH >= Level_CC) && (Level_CC >= Level_HL);
bool ZoneM = (Level_MH > Level_CC) && (Level_CC > Level_ML);
bool ZoneL = (Level_LH >= Level_CC) && (Level_CC >= Level_LL);
Now, I need my code to identify the price movement in terms of only one of the following two cycles:
Cycle A: The price is moving across ZoneM-ZoneH-ZoneL-ZoneM
Cycle B: The price is moving across ZoneM-ZoneL-ZoneH-ZoneM
Taking into considerations that:
When the current price (Level_CC) enters the ZoneH it should tells the control that; The Cycle A is dominant and get ready to detect the next ticks for Cycle A to be completed. ALSO,
When the current price (Level_CC) enters the ZoneL it should tells the control that; The Cycle B is dominant and get ready to detect the next ticks for Cycle B to be completed.
When the current price (Level_CC) enters the ZoneM it should resets the control and get ready to the next cycle and so on.
For each zone (ZoneH & ZoneL), there're two different cases or operators (per each) to be controlled as following:
Actually, I got lost with if-else and switch operators, and there's interference when using if-else operator and I'm not sure how to regulate them properly.
The following illustrative FIG shows that:
When the current price (Level_CC) exits the ZoneH just slightly above, it will be allocated in the next new ZoneL, so that; ZoneL_Alternative_Actions to be used.
When the current price (Level_CC) exits the ZoneL just slightly below, it will be allocated in the next new ZoneH, so that; ZoneH_Alternative_Actions to be used.
FIG. Price movement control using dynamic coordinates
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Dear All,
My MQL skills is too limited so please help and advice.
My EA uses EachTick as a signal mode.
There're always Three predefined zones as following:
Now, I need my code to identify the price movement in terms of only one of the following two cycles:
Taking into considerations that:
For each zone (ZoneH & ZoneL), there're two different cases or operators (per each) to be controlled as following:
Actually, I got lost with if-else and switch operators, and there's interference when using if-else operator and I'm not sure how to regulate them properly.
The following illustrative FIG shows that:
FIG. Price movement control using dynamic coordinates