detect vertical line
-
how can i detect the vertical line on the chart?
the ea is plotting vertical lines on the chart, and i want to detect if the vertical line is visible on 2 out of three previous candles (candle 1 candle 2 candle 3) -
You need to know the exact name of that object and then use the 'Delete objects' block.
-
@l-andorrà i didnt mean delete , i mean detect
-
Sorry, my fault. Then try this:

-
@l-andorrà i also noticed this block but the problem still stays the same considering the fact that i dont just want to detect objects i actually want to detect if there is a line on 2 out off recent three candles
-
I have to admit that graphics are my weak point on fxDreema. I cannot offer you an answer for that specific problem at the moment but it is a certainly interesting one. I will have to take a look..
-
The logic for this is easy - you need to start looking at the objects and for each one of them to find its Candle ID (shift) and check if it is between 1 and 3. Ideally, when you reach the desired number (you want to find at least 2) you need to stop searching for more (the loop needs to break).
Here is what I made: https://fxdreema.com/shared/mOnIB2tqd But I use few blocks + one variable for this, and I don't break the loop. So this is not the best way to do it, but it will work.
-
@fxdreema can you please explain how these blocks are working?
its a bit confusing to be honest -
Blocks 1 and 2 draw two vertical lines on candles 1 and 2. Block 3 initializes the counter variable to 0. Block 5 will search for all vertical lines on the chart, no matter there are none or 50. Blocks 5 and 6 will find all vertical lines on candles with an ID from 1 to 3. Notice that both of them are set to "picked in loop". That means that this search will be done permanently on the last three candles. Finally when BOTH conditions from blocks 5 and 6 are true, then the counter variable is increased by 1.
-
@l-andorrà thanks
So here is what I am trying to achieve, ea check if each of the previous 3 candles have vertical lines, or atleast two of them have vertical line, doesn't matter which two, then place a buy stop or sell stop, on these three candles high or low , depending on the conditions.
So in order to achieve that, I am assuming I will need to place a condition block to check if the counter value is above or equal to two, am I right or its incorrect assumption -
Technically yes, but notice that @fxDreema said his project does not break the loop, so you will have to do it.
-
@l-andorrà can you please take a look and tell me what i am doing wrong?
https://fxdreema.com/shared/UpoXifZbe
because the pink line should have moved to the candle 3 low.
-
Blocks 15 and 8 reinitiate your ob variable every time blocks 2 and 5 are true. However, I can't see that indicator on your screenshot, so I'm not sure that is what you are looking for. Do you need that indicator conditioning your variable?