@ambrogio Use "for each trade" loop, and just modify the looping direction and "not more than n" setting.

Posts made by roar
-
RE: How to close these orders?posted in Questions & Answers
-
RE: Loading EA .ex5 to MT5 fails in Visualize/Genetic Optimizationposted in Questions & Answers
@rhang Sounds like a missing custom indicator
-
RE: Add more than two variablesposted in Questions & Answers
@jaychyke said in Add more than two variables:
Please may I ask if the calculation is based on the last 15 candles?
Yes it's 15 by default, but you can change it from inputs:

Again, which names will the upper and lower lines be identified with by the EA: "upper bound" as named, or upper range as coded?
"Upper bound" is the name of that graphical object, "upper range" is the name of the numerical value the object is based on

-
RE: Add more than two variablesposted in Questions & Answers
Ok so I actually got very excited about this and figured out the whole thing:
https://fxdreema.com/shared/UeNF7iqdb
Seems to be working:

-
RE: Add more than two variablesposted in Questions & Answers
You dont need individual variables for each candle, and that method is a bit difficult to scale anyway. First rule of coding is to never repeat yourself. (well thats what I have heard, it's not like I'm some professional coder)
Use an array! You will have to study a bit, but you really cannot avoid some work given that goal.
Google mql4 array for instructions.
https://docs.mql4.com/array -
RE: Change position of pending orderposted in Questions & Answers
@fabien-s Use the "slide order" block. You will need some testing to learn how the mechanism works.
-
RE: How can I protect profits from returning to loss?posted in Questions & Answers
@khalids222 Ok, break-even block should do exactly that.
You have to switch the blocks in your example.
-
RE: How can I protect profits from returning to loss?posted in Questions & Answers
@khalids222 If you allow me to get a bit philosophical here, you really can't avoid losses altogether. When trading, you are exposed to a distribution of wins and loses, big and small. This fact doesnt change when using different strategy. Strategy can only change the return sizes - maybe many small wins and sometimes a huge loss. A trader can only hope that the average sits a tiny bit on the positive side.
For closing most trades at a profit, I often use to partially close some trades at RSI 70 (and RSI 30 for sells, respectively)
-
RE: HELP REALLY NEED WITH MT5 EAposted in Questions & Answers
@leonardo-1 It's not cheap to develop and maintain a software such as this, you should buy it if you plan to use it.
https://fxdreema.com/shared/1hIntlu8d
This version has 9 connections, you can compile it yourself
-
RE: HELP REALLY NEED WITH MT5 EAposted in Questions & Answers
If so, why not just using 'Once per bar' blocks with those same specified TF instead?
Yeah could put the timeframe inside the blocks just as well. This way is just a bit easier to understand for a newbie, I think.
I also prefer to use the individual TF blocks if I have lots of blocks belonging to a particular timeframe. -
RE: wait after closing tradeposted in Questions & Answers
@turelforex My solution is actually BS.. It checks for open time, not close time.
Here's some solutions for the delay:
https://fxdreema.com/forum/search?term=delay&in=titlesposts&sortBy=relevance&sortDirection=&showAs=posts -
RE: HELP REALLY NEED WITH MT5 EAposted in Questions & Answers
- Use "once per bar" on top of everything
- Use "set current timeframe for next blocks" to change between M5 and H4
Otherwise this is just putting condition blocks one after another, very simple. I'm too lazy to do the whole EA for you

You can share your progress via the projects-menu top left
-
RE: wait after closing tradeposted in Questions & Answers
This setup puts a 2-bar wedge between trades:

-
RE: Lot Size = Percentage of Balance in Martingaleposted in Questions & Answers
@bogdaiki Hi,
you can insert you balance anywhere by using the mql4 function balance().
This uses 1 lot for every 10000 in balance, adjust the factor to your liking.

-
RE: Help on Trailing stop block appreciated (SOLVED)posted in Questions & Answers
@l-andorrĂ I have a feeling this is unnecessarily complicated approach

Why doesn't "% of profit" work as a solution?
What do you mean by "11% of open price", isn't that like EURUSD crashes to 0.1234 ?

-
RE: My own expert advisorposted in Questions & Answers
@srgsegseg said in My own expert advisor:
How can i downlaod 5 years of history ?
Press f2 to open your history center. Or use mt5, its better for backtesting overall
-
RE: Coders! I am asking for your help Please.posted in Questions & Answers
@alphaomega Hi!
Mql4 code can't be imported into the builder, unless the code is made with fxdreema. This whole system must be rebuilt from scratch..
It probably would be easier to work with a written strategy description, rather than the code.
