Condition with weekly filter
-
How can I condition the weekly filter that closes the operations only if they are negative or have an amount less than "X"
-
@xyon126 Do you mean you need to close any open trades and not open any new one if before the end of this week you lost 1 € or your gains are less than X? I ask you this because gainig 1 € or 10000 € is exactly the same for the EA if you want it to stop when your gains are less than 20000 €.
-
@l-andorrà
No, mi idea es, en el caso que hayan varias operaciones abiertas con la EA cuando llegue el viernes solo cierre aquellas que estan en negativo, perdiendo dinero o que si estan en positivo pero con una cantidad "X" que seria menor que el costo del SWAP+COMISIONES, etc cerrase esa operacion u operaciones y si hubiese mas operaciones y estas estan en positivo, ganando una cantidad superior a "X" o SWAP+COMISIONES, etc continuasen. -
Hey, @XYON126
You need some "or" logic since you have two variables and if either is true, then it moves on. Your question is on the vague side, but the logic might be something like,
"Condition (whatever you're talking about) <= 0" (checks if whatever you're talking about is negative) True
Checks what day of the week it is with "weekday filter".
If you need a specific time also, then use a time filter afterwards.
Back up to your original condition. If it's true, it doesn't matter if the other one is true or false since this is "or" logic. But, if the first one is false, and the second one is true, then it's the same outcome.
So, if your first condition is false (output on the false side), then add a new condition that checks if whatever variable is below whatever value you have predefined (again, vague question, so I don't know what these are). If that's true, then connect it to your weekday filter and stuff, as described above. If it's false, then both of them must be false, so you don't need to do anything (unless you want it to do something special when both are false, also).
-
@cdwilder1 Thank you very much, but you would be so kind, even if it is a photo to indicate or show me what you tell me with the fxDreema, because there are issues that I do not know with what block and data to put in order for it to be done.
a greeting -
Unfortunately I can't make anything of much use because it's still very vague and not clear what you're asking, but logically, you need something to this effect.

-
I'm not sure what conditions or anything you're checking for, but you'd have one condition it checks for (whatever that is) and if it's true, then you pass it through your time filter stuff and close trades or modify things or whatever you're going to do after that.
If condition 1 is false, then it checks if condition 2 is true. That way, if either of them are true, it moves on. If neither of them are true, nothing happens (or you can put something connected to the false of the second condition and that would only be true if both conditions are false.
-
Thank you very much CDWilder1! But I think that with my terrible English I have not explained myself well, according to your photo you put the condition blocks and then the temporary filter, my doubt is not the temporary filters and the condition blocks, but what I have to include within the block of condition and the order and connection with the temporary blocks so that what I need is executed:
a) If there is an open trade that loses money, close this trade.
b) If there is a trade that has only won a max amount, close this trade.
c) That all operations with profits and with a minimum amount continue.And this applied to the time filter, in my case only weekly since swaps are expensive on the weekend but not daily.
-
@xyon126 said in Condition with weekly filter:
the time filter, in my case only weekly s
The idea still applies. You can filter for time before, if you prefer, but it's going to be checking for the time constantly, just like it's checking for the conditions constantly now, so I'm not sure if it matters all that much which one you put first or second.
You can use the "check age" if you like in place of the time time and day filters, if you prefer. You can use the check profit to check and see how much a trade is winning or losing.
I guess what I'm trying to understand is, what part in specific is giving you trouble? This appears to just be a series of really simple tasks, and at first, I thought your problem was that you were unsure how to connect them together. If there's a particular part that is giving you trouble, most of us are happy to help, but we're just like you--trying to build our own EAs and be successful traders. Hahaha. We're not paid by the company and we're not here to build EAs for people.
If you specify exactly which part is causing you problems, or you share a project file with the part that's giving you trouble, I'm sure we'd be happy to look at it.
But,
c) if it's being allowed to continue, you don't need to specify anything. It's already going to continue anyways, so you can ignore this part when you're building (I understand this information is probably just so we can help you)
a) and b) these are just two conditions (ignore the close trade part). You can check profit on a trade and see if it's losing money, that would confirm condition A as true. You can also check the profit of the same trade and see if it's above a certain amount (idk what this "max amount" is. Again, it's kind of vague).
Connect the false from A to the input for B then run the "true" from those to a time filter, check age filter, whatever method you wish to identify when the trade will be closed. Then tell it to close trades.
Maybe something like this.
