Create EA based on vertical Line
-
Hello All,
I wanna create an ea that triggered by vertical line :
Color Lime = BUY
Color Red = SELLas seen on below pic. But unfortunately it's not working yet. Any your help or comment are very helpfult!
Please see the chart here https://prnt.sc/PP-eVOOvGPPe
And the block is here https://fxdreema.com/shared/wtb84RmOdAre these blocks wrong?
Thank you in advance
-
@zedeai2
You have to be a bit more specific.
According to what you have explained, it would be enough to position the order blocks as below,
but that is probably not the problem.
And the objects should get a string variable and better not start with a number. (see example) -
@rgoo Hello, thank you for helping me

I tried your example of ea
But why in same time both order buy and sell are happening together?
Because it should be one order in one vertical line :
Vertical line Lime : BUY, or
Vertical line Red : SELLSomething wrong or anything else?

-
@rgoo Hello, sorry my bad explanation. Here is more detail explanation :
BUY : if vertical line LIME is appear at candle current (id candle = 0)
SELL : if vertical line RED is appear at candle current (id candle = 0)Thank you in advance!

-
@zedeai2
You are currently looking for objects that have the colour "lime" or "red".
Then draw a vertical line. When the line is drawn, you want to buy or sell.
Drawing the line is done by fulfilling one or more conditions. And you must also use this event for buying/selling. So do not draw a line first and then search for it. Because you want to buy / sell immediately when the line is drawn, don't you? The line is also not an indicator but an object.
Currently, the EA buys and sells at the same time because both objects can be found on the chart.
Which indicator do you use?

You are looking for a green and red object, these are the arrows.
When you have found them, draw the lines.
Even if you delete the lines afterwards, the arrows are still on the chart.You have to use the indicator directly.
-