@khalids222 Okay, that helps a lot. The easiest approach is to have an integer variable as a multiplicator for the lot size. Each time you open a trade for instance (or when one trade is closed depending on your preference) you would adjust that counter variable +1
I'm currently on my mobile phone and can't take a look at your shred project in detail.
Let me know if you require further help to implement the suggested solution.
Posts made by trader.philipps
-
RE: How I can open the same number of long positions in the sale, and vice versa in the BUY with a ONE increaseposted in Questions & Answers
-
RE: chart refreshposted in Questions & Answers
@zackry I'd try with the "Delete Objects" block. If you have a specific template you may use the "Change Template" block. But I think that would re-initialize your EA which should be re-loaded by the template.
-
RE: any tips u can give when testing ea on broker? should i switch to test on different ones?posted in Questions & Answers
@mynds9 It would help if you could post some evidences where your EA supposed to behave differently. There are so many ways an error can occur besides broker's manipulation. In any case you should check the Expert and the Journal regularly in order to see if there are connection or order filling issues.
-
RE: how can one make the EA put the stop loss on the moving average?posted in Questions & Answers
@ambrogio I think that looks good, unless you want the price to close above / blow MA and not only hit it.
-
RE: How I can open the same number of long positions in the sale, and vice versa in the BUY with a ONE increaseposted in Questions & Answers
@khalids222 Sorry to ask, but are you using google translate for your posts? I read your posts several times, but couldn't get what you want your EA to do. I think there is more a communication issue rather than a technical one.
-
RE: I am trying to limit trades to only 4posted in Questions & Answers
@jzfusion Delete the No trade block.
-
RE: EA from custom Supply Demand Indicatorposted in Questions & Answers
@l-andorrà I could compile the indicator without any issue. It's the common SSSR indi. However, what exactly the EA should do? The indicator draws a number of rectangles on the chart. The buffers are only used for the fractals.
-
RE: Is there a way to configure the EA to wait for 3 consecutive losses and then enter orders?posted in Questions & Answers
@trader-philipps And one more thing: Does the loss count have to divide sell and buy trades or does either of them count as long as it is a loss?
-
RE: Is there a way to configure the EA to wait for 3 consecutive losses and then enter orders?posted in Questions & Answers
@rafaels919 I'd like to come back to the fictive trades approach. However, I have some more questions or thoughts to sort out.
-
Do you want to loop back on EA start and see if the last 3 signals were losses? That would make things more complicated and may be a task to do once the fictive trade thing is more clear. The issue I see here is that I can look back only candle based and not tick based. That issue could lead to the point that a candle size could trigger both SL or TP, but I can't tell what came first as the candle just has 4 prices (open, low, high, close).
-
If look back is not necessary, would it be okay to store the loss counts in a variable? That would have the side-efect that if the EA get re-initialized eg. when input parameter changed or terminal was closed and re-opened, ounting would start at 0 lossses again.
-
-
RE: Once per bar errorposted in Bug Reports
@bgvulk May you share your project, please?
Може ли да споделите вашия проект, моля?
-
RE: How to trigger this trade?posted in Questions & Answers
@simenandreas It depends on your SSL indicator buffers. Here is one i tweaked a bit for buffers (initial indicator was not from me!). 0_1575024216293_SSL-fast-nrp.mq4

As you see in the screenshot, I exposed the trend buffer. If it's above 0 it's a long trend and if below it's a short trade.
If you want to stay with your own SSL indicator, you should have 2 buffers - 1 representing the green line and 1 for the red. just make an x> or x< condition on them should do the trick as well.
-
RE: EA with BBandsposted in Questions & Answers
@giovanni You can do this in the Builder like that ...

When you say buy at 2nd dot, does it mean on candle open or on candle close of that 2nd candle after first dot?
For close condition: Should it close when price crosses the dotted line or only if it closes beyond it?
-
RE: Correlationsposted in Questions & Answers
@fabiobioware Sorry, I didn't get what you want. Here are some basics about correlations https://www.mql5.com/en/forum/19246#comment_752712. As usually EU and GU move in the same direction, what exactly should happen? Are you trying to hedge your EU long trade with a GU short trade?
-
RE: How can a SL based on currency be set up?posted in Questions & Answers
@l-andorrà Here is a simple implementation without taking into account trading costs such as commissions, spread, etc.
0_1575001388915_pipvalue-simple.mq4
I hope the calculation is right like that. Maybe @roar may check. Further I put calculation on the onInit tab. Somehow it diesn't realize changing the constants unless you change the currency pair, but this is just ment to be a prototype. The pip value calculation I took from here (https://www.mql5.com/de/code/12418). So all honours go to the author.
-
RE: I need helpposted in Questions & Answers
@l-andorrà For the explanation of his post including the screenshot I think it does. Let's see if my crystal ball was right again 🤪
-
RE: Need who can code EAposted in General Discussions
@l-andorrà I took a look in my crystal ball and it says Need picture! There's just a screenshot missing I guess.
-
RE: How can a SL based on currency be set up?posted in Questions & Answers
@l-andorrà what @roar tries to do is to calculate the pip value in the base currency. You might check this thread if there's an indicator doing the job for you. https://www.forexfactory.com/showthread.php?t=54800
I haven't tried any of those, but maybe that's what you need.
Once you know the pip value you can divide your risk money by your static lot size and then you know your SL in pips. -
RE: Is there a way to configure the EA to wait for 3 consecutive losses and then enter orders?posted in Questions & Answers
@rafaels919 The trade statistic block only works if you traded that trades and the losses occured. I f I understood you right, that's not what you want to do. You want to have fictive trades (not executed ones) and those have to produce 3 losses, right? Do those losses have to occur consecutively - which means 3 in a row and not loss, loss, win, loss ?!?
-
RE: I need helpposted in Questions & Answers
@l-andorrà I think, it can make sense. If you want to run a block just once, than you should use enable and disable block blocks. In order to ease things up, I'd first determine what condition happens more often than the other. By common settings, the stochastic condition should happen more often, right?
In that case I'd do the following (for buys):
- check MACD line x> 0
- enable stochastic block (for buys) sto x> 50
- open buy trade
- disable stochastic block
And separate block:
- If MACD line < 0 disable stochastic block (for buys)
Does that make sense?