@jstap
"I use excel to compile using formulas before copy/paste"
What do you mean by (Compile) in Excel. Are using a certain application?
Or did you mean, using the autofill/drag for repetitive lines?
@jstap
"I use excel to compile using formulas before copy/paste"
What do you mean by (Compile) in Excel. Are using a certain application?
Or did you mean, using the autofill/drag for repetitive lines?
This is great. It is similar to the Mid/Left/Right functions in Excel to extract a number of charcters. I love it.
BTW: Is there a way to substitute variables inside the custom code without assigning them first in the variables table?
This will be another milestone in my project.
Cheers,
I will explain a bit more my (logic) and whether there is a better one you can suggest:
Let's say I have the seven groups of currencies with their scores
For Ex:
AUD 80
USD 30
GBP 60
NZD 28
CHF 78
etc..
Now when I apply the EA on a chart of for ex: (GBPAUD). I want to only take values from GBP and AUD scores. I will have a string constant for inputting the pair name.
The only logic I can think of for the next step is to use (Turn On/Off) Blocks.
But this means I have to input 46 (for 28 pairs) of Turn On/Off Blocks.
So my question is : Is there a way around it to have less number of Turn On/Off Blocks? That is if the only solution is to use these Turn On/Off Blocks. There might be another way to address it.
Thanks,
I need some sort of a road map.
The next step, after calculating the score for each currency group, is to check the inputed pair and link it to its Quote and Base currencies groups.
For example: If I input EURUSD, then the EA will reference EUR and USD Blocks while disregarding the rest of the blocks of other currencies.
This way, the EA will be more universal and can be applied to any chart.
Do you know how to check for the inputted currency?
Thanks,


I used Current (0), Low(0), and Open (0).
@jstap
The link you provided was great for me to start building on it. I understand now the logic of combining both Modifying Variable Block and the Custom MQL code Block.
Now, is there a way to type: 1- pairs 2-Time Fame in the MQL Code Block?
Thanks,
I will look into the text provided and the comments.
I believe using current high and current low won't be an issue. I am using them for averaging strength and calculating overall scores not to trade them per se (as this is against logic). I already have the formula in my Excel sheet without any issue. As soon as we get one tick, we already have a High and a Low, and if we do not get this tick and stay at open price, the high and low is at the open price.

I will report back on how it goes.
Thanks,
Iam calculating strength over a group of pairs by averaging the strength of seven pairs per currency and then conditioning based on a threshold.
EX: if EUR > 80 percent and USD < 20 percent then Buy EURUSD.
Thanks for your help
So lets say I want this simple formula: (Close (0) - Low(0) )/(High (0) - Low (0)) and assign it to a variable and a specific pair.
I will type seven of them for example.
Where do you think I should start from for such basic formulas? I mean to learn how to use the minimum needed.
I am more of an Excel user and never coded anything in MQL4.
I am thinking that to be more practical I need to customize an indicator for my currency strength formula. I will hire a coder.
Should I ask the coder to output buffers in numbers or in color or both? What buffers are easier for FX Dreema to pick?
In case I want the EA to check the Pair so I can inverse it. For example, I want to inverse AUDUSD to read as USDAUD.
Is there a block to check the (string constant) and reverse the value? I mean to be done automatically.
Thanks

Your suggestion to use the comments helped a lot to track down what is wrong.
First, the Total Size of the Candle in Pips was causing a problem. So I substituted it with raw calculation (High - Low).
And a second block for (Current - Low). Lastly, a third block for the calculation (Current - Low) / (High - Low) * 100.
I can now continue with the project. I wish if I knew how to write simple Arthimetic formulas in the Coding Block. I would use much fewer Blocks.
BTW: How to round numbers in the Comments? and Also to get rid of the last number next to the readings?
I wanted to input the pairs myself in the EA when applying it on a chart or for backtesting.
However, I now have inserted the symbols inside the blocks and removed all strings so there is no referencing for symbols.
Still, it is not working.
When you have some time, please check the formulas for the first two blocks (pairs) and that will suffice for the overall logic.
Thanks
@jstap said in Buy a EUR pair when Conditions are met from three Pairs:
@mohamed80 Hi Mohamed, I will gladly go over this and see what I can, first though the symbols are correct in being strings but, to me there was no string in the constant? is this how it is for you? Also put variables/constants in a comment block then you can see if correct result is within, allows for easier fault finding.
I used the parameter (Candle Total Size in Pips) to give me the same value as (High - Low).


I created this EA that would trade on one EUR pair based on the overall bullish score of EUR.
The calculation is simple. For each pair: (current - Low) / (High - Low) *100. Then averaging all values and assigning a threshold.
I am not sure what is wrong with the structure I made as it is not executing any trades in backtesting.
https://fxdreema.com/shared/dqieJ3eYd
Thanks,
How silly of me! It might have been after spending so many hours on numerous projects.
Thank you for correcting me.
Hello,
I have a very simple EA to build on later.
The EA will buy EURUSD if the price of each pair (EURUSD, EURGBP, EURJPY) is above SMA 5.
I created this for MT5 https://fxdreema.com/shared/ggHkL4Fjb but is not working in backtesting.
I just created a condition for each symbol to be above its SMA 5.
Can someone comment on what is missing?
Thanks
Can you connect them because I tried but it did not work.
Sometimes (depends on what blocks I am using), the stop loss widens more than the initial one. i.e, stop loss is modified but the stop its self widens if it is a losing trade.
Unless Check Unrealised Profit Block is not a condition per se and may be I need a formula block to get value from the Profit Block.
@jstap
This means my logic should be right. In Block 160 I am checking for profit. If so, the stop should get modified in Block 165 and so on.
But it is not the case.