Failing to Identify the best way to set a Moving Average Threshold to use in my MQL5 EA

Failing to Identify the best way to set a Moving Average Threshold to use in my MQL5 EA

Manage alerts

Loading saved threads...

ken · External communityPost link
External question — Stack Overflow Stack Exchange Author: ken Original post: https://stackoverflow.com/questions/78535178 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Iam writing code in MQl5 for an EA that uses Moving Average. I have a part where I get the Moving Average value at that point and compare it with a value which is the moving average threshold after which I base on that to proceed with other logic. My problem is I need a standard way to determine this moving average threshold. I have read but most just say pick a value near the current price but that hasn't yielded much because how near is not defined. Please help me on this. Below is the code I use to compare Moving Average with Threshold { Print("MA is below the threshold. Waiting..."); return; // Exit if MA is below threshold }```
Quote
Report
Sadegh Molaei · External communityPost link
External answer — Stack Overflow Stack Exchange Author: Sadegh Molaei Original post: https://stackoverflow.com/a/78702345 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have two ways : Using the "strategy tester" and updating your "Expert Advisor" parameters with each test at different time intervals (for example daily, weekly, ...) If you have a suitable server for this purpose, you can write a piece of code for this purpose and put it in the "timer" event so that the parameters are automatically updated. (update parameters in shorter time)
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: ken Source score (net votes, not local likes): 0 Original post: https://stackoverflow.com/questions/78535178 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Iam writing code in MQl5 for an EA that uses Moving Average. I have a part where I get the Moving Average value at that point and compare it with a value which is the moving average threshold after which I base on that to proceed with other logic. My problem is I need a standard way to determine this moving average threshold. I have read but most just say pick a value near the current price but that hasn't yielded much because how near is not defined. Please help me on this. Below is the code I use to compare Moving Average with Threshold { Print("MA is below the threshold. Waiting..."); return; // Exit if MA is below threshold }```

Cancel quote

Checking account access…