Check Loss question
-
Hi
I have a strategy that works on the chart. This strategy opens trades on several pairs.
I would like to create a strategy that would close the various currency pairs at a certain loss. Expressed as a percentage of the balance.
For example: I opened EURUSD, GBPUSD, EURJPY, GBPJPY.
And on a pair GBPJPY loss is -100 USD. (Balance $ 1000) and it is 10 percent of the Balance.
And now I want to close only GBPJPY - created such a strategyhttp://fxdreema.com/shared/0K4YuZfnc
but it closes my every position on GBPJPY, regardless of the loss.
Where a mistake.I trade Armadamarkets and prefix is there GBPJPY
-
This block "check loss" is not to be used like this. But I just answered the same question here: topic/2426
-
Thx !
FxDreema you are great
!Best Regards
Radoslaw
-
Just one more question.
strategy
http://fxdreema.com/shared/dXN1dMS5b
I would like to add in the code the " extern ????? Currency = EURJPY " to easily change the currency in the MT4 terminal.
What should I enter in the code created strategies:extern char = EURJPY?
extern string = EURJPY?Please help

-
Use string. This char is new for MT4 now, but it's one of these various numeric formats. I don't know what they are thinking, there are more than 10 numeric data types in this "programming language". I never experienced too much of RAM usage with any EA, as a thing those EAs are really small and lightweight, so what's the point... I don't know.
But anyway, in fxDreema there are some input options, what I can suggest is to define this as a Constant, look on the right side Constants (Inputs). Select "text" there.
But why you will want to define currency? If it is multicurrency strategy I understand, but if it uses only 1, then it is already defined - the default currency is that on the chart. In other words, when you add EA to EURJPY chart, that EA knows that currency and it will use it as a default.