how to make Take Profit double Stop Loss
-
Hi,
I need the Variable TP = Nยบ X SL
My Stop loss came from my indi so I need calculate the Pips of SL and moltiplicate it X Constant (EJ: 2 for double) to set TP
Are there an easier solution?
I do it:
-
Formula in INIT to moltiplicate "constant" X 10.000
http://screencast.com/t/BcFA3gLPm
http://screencast.com/t/BcFA3gLPm -
Two FORMULAS (buy/sell) to calculate nยบ pips stop loss
http://screencast.com/t/y8vsfl0ei
http://screencast.com/t/y8vsfl0ei -
Two FORMULAS to calculate nยบ pips X (result formula point 1)
http://screencast.com/t/SAErjSw2Wv
http://screencast.com/t/SAErjSw2Wv -
I use the last result in the set TP (buy/sell)
http://screencast.com/t/1wYDkgPts0Mc
http://screencast.com/t/1wYDkgPts0Mc
It work!!! ...but maybe there are too much formulas and steps!

Can you tell me if there are another way please?
Many thanks.

Regards
-
-
I can see that there are too much Formula and Modify Variables blocks
Setting and modifying a variable is something really simple actually, but when it takes a whole block or group of blocks... you can see how bad it looks. But how can we do this with blocks and without writing code? I can suggest to use the "Adjust" fields when possible, also use this side panel "Variables" which you can see in every block's settings window. In both places you can write anything and it will go directly into the code. I can also suggest "Custom MQL4 code" block.And connecting these blocks like this in parallel... I don't know why people prefer to do it that way, but this creates problems sometimes. Note that when you have blocks in parallel, which one will run first, do you know? So it's better to connect them one after another, just in case.
-
How about this?
-
Ok, this is simle. Look at the numbers of blocks - 1, 2 and 3. Blocks 1 and 3 are "first" or "top" or "initial" or however you call it... blocks. They are connected only from their outputs, so they are at top level and they will be executed from the EA for sure - on every tick. Which one will run first? The one with lower number - 1. Which one is next? When 1 runs and passes, the next one is 2. And finally - 3. Here is more about that: https://fxdreema.com/demo/blocks-execution-order
Otherwise you can try this: http://prntscr.com/4qyvvq If what you want is to make TP 3 times bigger than SL...
-
Hallo,
great... perfect! ...more valid solutions!! Thanks!
