How can a SL based on currency be set up?
-
I remember having read a thread a long time ago in which it was explained how I can set a SL variable based on currency amount. Let's say for example I want to set a SL for a maximum loss of $200. How can I do that? However, I simply can't find it

Could someone please help me?
-
@l-andorrà Check one of the risk conditions.

Or do you mean you have dynamic SL but a static lot size?
-
Just the second option. I have a static lot size and I need a dynamic SL. I'm afraid this is not mi field of fxDreema expertise.

-
@l-andorrà My very first post on fxdreema?
Maybe this helps...https://fxdreema.com/forum/topic/6480/stop-losable-positions-at-1-of-equityEDIT: Oh, I see you found something, (the in loop condition) on another thread. My suggestion has the flaw(depends) that it looks for the whole account, and maybe there are more than one EA.
-
You're the man, CPxiom!
I think this is a very good solution for what I'm looking for. Thank you very much. -
@l-andorrà Great to hear that
Problem is, it takes into account the whole equity generally... if it would be possible to check per symbol, or per EA, then that would be more flexible... although the danger would be that losses could add up on some occasion, and not know about it, only after it's too late. -
@l-andorrà What is the solution for your issue? It doesn't calculate SL that equals a certain amount of money with a static lot size. However, if you're happy with it, that's fine.
-
You are right, trade.philips. It doesn't solve my problem. How can I calculate the SL at which the current trade should move for a specific amount of money?
If I choose a trailing stop of 10%, for example, this means that SL should move to a price level in which, if hit, trade would lose no more than 10% of the current balance. Obviously this needs to be done on 'On tick' tab.
Suggestions are welcome.
-
I know the basic formula to know the distance in pips:
A (Pips to SL) = B (lot size) / C (Amount of money to lose)
Considering that I know B and C, I can calculate A easily. The problem is the accounts' currency. That formula is perfect for EURUSD if the account is in USD, but not in EUR. How can I 'change' it into my currency, whichever it is?
-
Any hint?
-
@l-andorrà Are you asking, how to convert dollars to euros?
Multiply the final result by 1/EURUSD ?
For example, 1/1.1070 -
No, no. I'm asking how can I transform equity into pips. I have an EA in which lot size is fix. I want to open a trade with a SL level calculated as money. For example, I want to lose no more than €50. I insert 50 as a constant and I don't know how to convert that number into pips for a variable used in the buy/sell now block.
I'm still trying to guess how to do it, but to no avail so far.

-
@l-andorrà If you trade EURUSD and want the SL as euros, here's the formula:
SL (price fraction) = risked money / (lotsize*100000) * iClose(NULL,0,0)
That last part is the current EURUSD value
-
I think you might need an indicator to do the job but what you are saying is you want to set a Stop loss based on amount of money input. So instead of checking loss and closing at x loss you want to enter a number in money and then convert that to a SL ?
-
@hadees said in How can a SL based on currency be set up?:
I think you might need an indicator to do the job but what you are saying is you want to set a Stop loss based on amount of money input. So instead of checking loss and closing at x loss you want to enter a number in money and then convert that to a SL ?
Yes! Exactly that. Any idea how to do it?
-
@roar said in How can a SL based on currency be set up?:
@l-andorrà If you trade EURUSD and want the SL as euros, here's the formula:
SL (price fraction) = risked money / (lotsize*100000) * iClose(NULL,0,0)
That last part is the current EURUSD value
Thank you very much for the formula, but does it work for any symbol? I wouldn't like to write all symbols on the project options. On the other hand, I see that a custom code should be used, but how would it fit into a variable to be inserted into the buy/sell now block? Obviously it should be calculated previously.
-
@l-andorrà It gets complicated when applying to other pairs - you have to convert the base/profit currencies to eur/usd currencies to "standardize" the pips.
When trading eurusd, you can just put the formula into the box:

-
@l-andorrà When I think about it, actually it doesn't get that much more complicated.
You just need to do the final correction with a pair EURxxx, where xxx is the base currency of your chart.
Example: when trading GBPJPY, sl formula is now:
SL (price fraction) = risked money / (lotsize*100000) * iClose(EURJPY,0,0)https://fxdreema.com/shared/mmBhaLp9
Check this example project, it's mql5 though -
Thank you very much. Very interesting. Let me take a look at it.
-
@l-andorrà You might also consider trading costs such as commissions. That can be significant for a scalper for instance. And also consider minimum stopplevel on symbol as that can easily mess up your risk management.
All in all I don't think that that approach is a good one as it keeps out market condition from risk calculations at all.