Open position when the candle opens close position when the candle closes
-
MQL5 the project is this: after a bull candle signal i buy. after a bear candle signal I sell. on the other hand, i've been very careful to put the signal type of both candles on Once Per Bar. However it doesn't respect that. for example if a bullish candle appear, it opens a buy position but if during the position, the bulish candle become a bearish one, it close automatically the position and open a sell position; though I have put on the Once per Bar signal in both candles. How can I solve it? thanks in advance
-
@nehemiah7 Can you please share your project?
-
@l-andorrà there you are https://fxdreema.com/shared/muqMugCSc
thank you -
@nehemiah7 You should specify 'candle ID 1' on blocks 2 and 3 and not candle ID 0 as it is now.
-
@l-andorrà OKay let me try this out
-
@l-andorrà it works fine thantks. but another thing is that I want each position to last the duration of one candle. in other words, if the position doesn't hit the stop loss or the Take profit, I want it closed at the end of the candle. how can I do that? thank you.
-
There is a time variant block , I'm on my phone atm but , close after 4 hrs ect if your using 4 hr chart . Block will close after set time period pretty easy.
-
@mcarl42 Mcarl is right. You can determine the duration of your trade here:

-
@l-andorrà @mcarl42 thank you guys
I'll try that out once I got home -
@l-andorrà I tried but it didn't work. I don't understand!!!
-
Hello;
This structure tries working.
When the candle closes, it closes the transaction.
-
@dragonfly617 let me try that out
-
@dragonfly617 Block 7 should be below block 10, not above.
-
I must have missed something
it's not working!!!!! -
https://fxdreema.com/shared/zyRjDV8Mb I don't understand

-
@nehemiah7 Question - Does EA open order but not close properly?
This is what we do, after the order is opened, it must close the orders at the 3rd candle close.

-
@dragonfly617 does the numeric value refer to the timeframee the candle? I though it was refering to the timeframe!
-
@fxdreema I need your help on this one.
-
-
@dragonfly617 Indeed!!!! it works!!!! thank you so much!!!!