Problem with ID candles
-
pls once the conditions are true, how do place orders evenly within or inside a bar, let say a bull candle of 5 pips.
-
I want to create an easy EA the should open a buy/sell at the following candle's open price. I made this:
https://fxdreema.com/shared/l7ZvIRgCb
Sadly, it launches a trade without waiting for the current candle to close. I guess it's a problem with the candle's ID. I tried using ID 0 and ID 1, but to no avail. I launces a trade at the first tick immediately after the EA is activated. Some help would be appreciated.
-
I think you should use "once per bar" item.
-
change your buy now to buy pending order/ sell pending order in open price candle
-
-
Sorry, I didn't explain myself properly. I don't want to open a new trade each new opening bar. I want to do it at a single bar opening after three other conditions are previously applicable. What does ID candle mean: the current one or the previous one?
Thank you for the help
-
I modify my previous message. I now can open a trade at the beginning of the candle by using "once per bar" block. My problem now is that it always open a new trade at the same bar active right now. How can I delay it until the beginning of the new bar?
-
You need to make your conditions' candle ID's = 1
-
"Once per bar" knows which is the current bar and this block can only pass 1 time per bar. When it runs under "on Tick" and there is no block above, then "Once per bar" passes in the first tick of each new bar (or candle).
If the block is under some "Condition" and that "Condition" passes somewhere in the middle of the bar, then "Once per bar" will pass at that time, let's say at 20th pip in that candle.
There are "Candle ID" parameters in many tools in "Condition". The EA always knows the OHLC values of the visible candles on the chart, so when you change "Candle ID" you can get O, H, L or C from the 20th candle, or from the 35th, or from the candle you want. The same is true for the indicators. You can get indicator's value from the 3rd candle or from any particular candle just by changing "Candle ID"
-
Now I fully understand. It's clearer. BTW I want to move my trailing SL AFTER two candles have passed since the trade opened. Does it mean I should use candle's ID 2? But then it shoud move without looking back. How could I do that?
-
There are many options in the trailing stop block, including one Trailing Start that is used to "delay" the process of moving SL, but with pips, not with time. This block does not care about the age of the trade and there are no options for this. Trailing stop can be made with pink blocks (For eact Trade and so on...) like this: https://fxdreema.com/demo/mt4-loop-trailing-stop This example is pretty basic, but you can add "check age", you can prevent "modify stops" from modifying stops of the trades younger than X minutes. But I think you want to "delay" with pips, so try the Trailing Start option in the Trailing stop (each trade) block

-
I forgot, in "Buy now" and "Sell now" there are expiration settings. Of course, this works only if the EA is working.
-
Ok. Thank you. I'll give it a try. Your site is priceless.

-
Please do not duplicate questions. I answered you in the other old thread.