@l-andorrà pass blocks are always necessary .. because they're beautiful!!!
Posts made by trader.philipps
-
RE: The clock seconds do not count well.posted in Questions & Answers
-
RE: Help on Trailing stop block appreciated (SOLVED)posted in Questions & Answers
@l-andorrà You can calculate them in the loop. Shouldn't bei so hard for the CPU as it's all in memory.
-
RE: wait after closing tradeposted in Questions & Answers
@fabien-s Well the trade can be closed at any time during the current candle. In the delay block you can just specify seconds. Hence one would need to calculate the seconds from now (when trade was closed) to the desired candle open time in the future. Right?
-
RE: Help on Trailing stop block appreciated (SOLVED)posted in Questions & Answers
@l-andorrà Besides that the SL prices are wrong in calculation I think I got what you try to do. And I still believe that you can do this with the standard trailing block.
Even if the inputs are variable depending on open price, trailing start trailing step and trailing stop are static from there on, right?
In your case if I get it right it's
trailing start: 0.04493
trailing step: 0.04493
trailing stop: 0.01123Is that correct? In that case you just need to calculate those values and place the variables in the input fields. Maybe you need to transfer in Pips using the
MathPow(10,_Digits-1);multiplicator. Or if possible use the price fraction. -
RE: EA does not count the time well in seconds.posted in Questions & Answers
@juan-manuel-quiñonero As you are on on Tick tab, sometimes ticks don't come in within the second. Use the on Timer tab instead if accuracy to a second is required.
Btw. Double post please avoid! https://fxdreema.com/forum/topic/8531/the-clock-seconds-do-not-count-well
-
RE: close path bar for same order ?posted in Questions & Answers
@khalids222 Because you didn't understand how to use the switch ON blocks are meant to work.
You switch Buy path after a Buy trade was opened only on again, if the Sell condition is met. Like this the next Buy will take place only after at least 1 time a Sell condition was in place.
If you really want Buy / Sell / Buy sequence, than do the foloowig:
- Delete the control path.
- On Buy path place after Switch Off Buy Path a Switch On Sell Path block
- On Sell path place after Switch Off Sell Path a Switch On Buy Path block
I introduced the Control path to have conditions for Each direction to be checked regardless of if an opposite order was triggered (remember the MACD example for continuation trades).
-
RE: close path bar for same order ?posted in Questions & Answers
@khalids222 what do you mean? A sell should be filled by a buy and then a sell again?
In that case you might use the switch ON/OFF trick discussed in a different thread here recently. -
RE: Help on Trailing stop block appreciated (SOLVED)posted in Questions & Answers
@l-andorrà Did I get you right that you want for 2and adjustment the same value percent of the current SL as pricefraction for the 3rd adjustment and so on for all next?
As I asked before, please have an example for understanding what you try to achieve! -
RE: closing pending orderposted in Questions & Answers
@rusen Haven't tried this, but expiration may be the key. Maybe it works like that.

-
RE: stop loss based on ATRposted in Questions & Answers
@trader-philipps said in stop loss based on ATR:
@akulus Actually "*MathPow(10,_Digits-1)" should give you the Pip multiplocator for price sections. Keep in mind that for a 5 digits broker 1 Pip is 10 points!
However, if you create a constant of type double named cdSLAtrMultiplicator, in the adjust field you would put ...
cdSLAtrMultiplicatorMathPow(10,_Digits-1)
The good thing about the Mathpow approach is that it works on 2 or 3 digits instruments such as gold or jpy pairs as well!
Somehow the editor changed my formular.
*cdSLAtrMultiplicator * MathPow(10,_Digits-1) -
RE: stop loss based on ATRposted in Questions & Answers
@akulus Actually "*MathPow(10,_Digits-1)" should give you the Pip multiplocator for price sections. Keep in mind that for a 5 digits broker 1 Pip is 10 points!
However, if you create a constant of type double named cdSLAtrMultiplicator, in the adjust field you would put ...
cdSLAtrMultiplicatorMathPow(10,_Digits-1)
The good thing about the Mathpow approach is that it works on 2 or 3 digits instruments such as gold or jpy pairs as well!
-
RE: stop loss based on ATRposted in Questions & Answers
@akulus ATR is a price fraction. You may use the adjust field an enter there
*MathPow(10,_Digits-1)
in order to get the fraction as pips.
You also may consider the search function as ATR based SL is one of the top requests here. -
RE: Help needed in modifying values in a sequenceposted in Questions & Answers
@rafaels919 With @roar 's solution you can step back and forth to any position. You may also consider another variable for the sequence position and modify this only and keep the losses variable as is if that makes sense.
In the concrete case if you want to step back 2 sequence steps, you would
a) check if losses >2
b) count losses-2In the case you want to step forward you need to ensure that the result is not bigger than the sequence index (roar uses the variable seqLen). And of course always keep in mind that the array is 0 based.
-
RE: basic ma touchposted in Questions & Answers
@fabien-s Well, candle ID0 should be the right way even if I don't use it that way. Does it always happen this way? As the MA is repainted on candle ID0 as well, the result on the chart may not reflect the time when the MA cross or touch has happened.
-
RE: Changing daily variable from a constantposted in Questions & Answers
@tcanuto Do you mean you need to store all the values you enter somewhere in a list or array? Or do you need just the most recent ones?
-
RE: Help needed in modifying values in a sequenceposted in Questions & Answers
@rafaels919 Don't take the code for granted! It should show you the way you can go.
-
RE: Help on Trailing stop block appreciated (SOLVED)posted in Questions & Answers
@l-andorrà okay, tried to understand your approach, but my brain didn't make it in the end.
May you please repeat the price levels when the stop should be modified and at what distance?EDIT
After reflecting once more, I still don't understand why you can't use the regular traling stop as the values are variable per trade, but the basis is static as it's the open price.Example: My asset has the price of 100 USD and I'm in a Buy trade. My trailing starts at 11% profit and SL is set to 4% of open price.
- Adjustment - at 111 USD -> SL 104
- Adjustment - at 122 USD -> SL 108
- Adjustment - at 133 USD -> SL 112
If that is what you want to achieve, all input values such as start, step and stop are static for the trade, right?
With static values and assuming that the 1 pip is 1 point, it would look like that, right?

If that is still right I think your mistake is in calculating the price percentage as pips. But let's do one step after the other.
-
RE: Changing daily variable from a constantposted in Questions & Answers
@tcanuto Not sure if I get your question right, but you cannot change the value of constants. Use a variable instead!
