Thank you very much for your help! I created a screenshot to explain what I am searching for, the red indicator is 25SMA and I want to get as an alert how many candles ago the price crossed 25SMA. So, I want to get alert about the number that is marked as yellow.

Posts made by MMaarits
-
RE: Alert about how many candles ago price crossed MAposted in Questions & Answers
-
RE: Alert about how many candles ago price crossed MAposted in Questions & Answers
Thank you very much for your help! I made this change, but unfortunately it still doesn't work as expected.
The initial idea was to implement following logic:
If price is above MA, check when it crossed above MA and alert
If price is below MA, check when it crossed below MA and alert -
Alert about how many candles ago price crossed MAposted in Questions & Answers
Hello,
I would like to get information about how many candles ago price crossed MA, I created EA for that, but unfortunately it doesn't work. What is wrong there, link to shared project is here https://fxdreema.com/shared/RANrLu32c?
Thanks a lot!
-
FXDreema generated code is not working in MT5 strategy testerposted in Bug Reports
The problem is that SL/TP-s are not triggered when testing multicurrency EA using "Open prices only" modelling. I will describe the problem in step-by-step tutorial:
-
Please find from here https://fxdreema.com/shared/5ZhNrcDpb a very simple MA based EA (it takes trades in every MA cross), after that move the file into MT5 Experts folder
-
Please run the test with following parameters

-
Please observe during the simulation how SL/TP-s are triggered in Strategy visualization window (you will notice that they are not triggered at all) e.g EURGBP currency pair (this problem is not related with certain currency pair, you can check also some other pair)

-
Check the Balance / Equity graph - at the end it will drop to zero, because all orders are getting stop-out's, and that is explainable because TP/SL-s are not triggered, total amount of losses are bigger than equity and that's why all orders get Stop-out's.


In conclusion testing multicurrency EA using "Open prices only" modelling is not working properly, because TP/SL-s are not triggered. It is working if you use other type of modelling, e.g "Every tick" modelling.
-
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
@roar Thank You very much! Yes, I will do the rest by myself. Thanks a lot again!
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
@l-andorrà said in FRACTALS DEFINITION:
@mmaarits Yes, reading backwards is alway more effective. However, the only way to do it is by creating a loop to do that. That is not my field of expertise, though.
Maybe roar could give us a hand? 
@roar Can You help me out? That would be awesome!
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
My original idea was to have 4 variables:
- latest_Fractal_up
- previous_Fractal_up
- latest_Fractal_down
- previous_Fractal_down
First condition is that previous Fractal up and Fractal down must not have default values (that means I have stored also previous Fractals values and not only latest Fractals values).
After that for a SELL trade, the second condition is that latest_Fractal_up < previous_Fractal_up
AND latest_Fractal_down < previous_Fractal_down
and vice versa for the BUY trade.
BUT, I need to update previous_Fractal_up/down variables if new Fractal appears, that means previous_Fractal_up/down needs to replace with latest_Fractal_up/down value. Unfortunately, I am not able to implement that logic.The better idea would be to implement logic in another way, because previously written algorithm needs to run EA for a while until it gets all Fractals values. Much better way would be, that EA reads Fractal values backward. That means, EA checks if Candle ID 3 has fractal values, if not, then check Candle ID 4. If Candle ID 4 has upper Fractal value then the EA stores it and continues this checking process until both previous (not only latest) Fractal up and down values are stored.
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
@l-andorrà No, I do not want to compare fractal up and fractal down, instead of that I would like to compare one Fractal before the very last Fractal and the last Fractal. That means: one fractal up before the very last fractal up > last fractal up AND one fractal down before the very last fractal down > last fractal down = SELL
And vice versa for the BUY trade: one fractal up before the very last fractal < last fractal up AND one fractal down before the very last fractal < last fractal down.
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
@l-andorrà said in FRACTALS DEFINITION:
n you need to store all those values into three different variab
Why it is necessary to have three different variables? Can You explain it a little bit more?
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
ggrobot stores Fractal values, compares it with current candle close and then takes trades.
But I want:- If the latest downward Fractal is lower than previous downward Fractal AND latest upward Fractal is also lower than previous upward Fractal - then it is a SELL trade.
- If latest upwards Fractal is higher than previous upward Fractal AND latest downward Fractal is also higher than previous downward Fractal - then it is a BUY trade.
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
@l-andorrà No, it is not a wrong link
I have not implemented it yet, because I do not know how to do it. I thought that you need a empty project to implement this logic. -
RE: FRACTALS DEFINITIONposted in Questions & Answers
Okay, I created shared project. Link to the project is https://fxdreema.com/shared/tb6ewhA5
-
RE: FRACTALS DEFINITIONposted in Questions & Answers
Hi all!
Thank you for implementing the current Fractal logic! I have similar challenge. I need to compare last 2 downwards and last 2 upwards Fractals. I mean:
- If the latest downward Fractal is lower than previous downward Fractal AND latest upward Fractal is also lower than previous upward Fractal - then it is a SELL trade.
- If latest upwards Fractal is higher than previous upward Fractal AND latest downward Fractal is also higher than previous downward Fractal - then it is a BUY trade.

Can anybody help to implement this logic?
Big thanks in advance!
-
RE: Issue with magic numberposted in Questions & Answers
@fxdreema said in Issue with magic number:
nd at the end I uploaded the latest compiler. I think that it works now.
Thank You for Your reply! The comment will appear on chart when I drag new currency.
My problem is also that I am using "No position" block, but if my semi-automated script will place a trade then it would not go through that "No position" block again, despite the fact that I have changed currency.
I need that my script is using following logic:
If all trade conditions are not met - alert me
If all trade conditions are met - place one trade
--- Now I change currency and it should start checking all trading conditions again, but unfortunately if it just placed a trade then it stops, because I use "No position" block and the script with this current magic number has placed a trade. -
Issue with magic numberposted in Questions & Answers
I created rule set for trading. If one of the rule is not met then it alerts me with the information. If all rules are met then it places one trade. I would like to use it as semi-automated script - I add it to my chart and then it start alerting me which criteria is not met. After that I drag a next currency into my chart and then it tells me also which criteria is not met (about that spefic currency). Rule set begins with block "No position" (MT5). In condition where all criterias are met and it places a trade it stops alerting me. If I drag next currency into my chart it doesn't alert me anymore. If I delete the placed trade it will place the same trade again despite the fact that I dragged new currency into my chart and it should place a trade with current currency. I think that the EA stops, because current Magic Number has placed a trade (it doesn't matter if the currency has changed). But I wish that it is working continously - after placing one trade in specific currency it will continue to alert me on another currency chart and placing trades also.
-
RE: Profit trailingposted in Questions & Answers
@josecortesllobat WOW! Thank You very much!!! I will test it tomorrow when the market is open.
-
RE: Profit trailingposted in Questions & Answers
I tried to use "check distance" block, but it doesn't work also.

-
RE: Profit trailingposted in Questions & Answers
@roar Thank You again for the very quick reply!
And I want also to thank You for the solution! It's great and helps me too!
My idea is to protect profit and my initial idea was to do it with 3 steps. Those levels seemed valid.
Profit levels description:
12,5% level - to avoid loss
25% level - minimum profit
50% level - good profit
TP level - excellent profit -
RE: Profit trailingposted in Questions & Answers
@roar Thank You for the quick response!
Unfortunately I did not find that option in trailing stop block.

I tried to do the following:
Check distance between open price and TP and if it is 75% then modify SL to 50% etc. But it did not work.

-
Profit trailingposted in Questions & Answers
Hello,
I want to set TP and SL manually and I would like that the algorithm will trail my profit and will do following:
if price has reached 25% of TP level, move SL to 12% of TP level
if price has reached 50% of TP level, move SL to 25% of TP level
if price has reached 75% of TP level, move SL to 50% of TP levelfor example: I set manually TP level to 100pip. And if price reaches to 25 pip from the open price, then SL is moved to 12pip level. If the price reaches to 50 pip from the open price, then it moves SL to 25 pip. If price reaches 75 pip from the open price it moves SL to the 50 pip level.
Could anyone help me to implement that logic?