purchase problem
-
I wrote a robot based on candlesticks.
Whenever the candle with ID 6 is larger than the next 5 candle and the previous 5 candle, it draws a line on the high of that candle.
So far, it works correctly.
But when I say, "If this line is crossed upward, take a buy position," after closing the position, it continuously opens new buy positions for me.
https://fxdreema.com/shared/X8DayNi0b
-
You could try using the time filter "Once per bar" and put right after your buy condition or right before your buy order block.
-
I've already done this.
After opening a position, my line gets deleted.
The entry condition for the trade is the line's cross.
However, even after the first position is closed, it keeps opening positions continuously.

-
Have you tried "once per object" instead of "once per bar"?
-
In that case, it specifies only once and does not open new lines until the price reaches it
-
It's strange. I tried replicating your strategy for ex4. but in my case it'll draw lines fine, but won't enter any trades. Unless there's something I'm misunderstanding about the different blocks and how the work (which is quite likely), I kinda suspect some kind of bug somewhere.
-
If we want to explain it simply: whenever several bullish candles are formed (bulls in a row), place the line on candle ID 3, and then take a position after the cross — this works perfectly.
However, the conditions don't work properly, even though the lines are drawn correctly.
-
@ennoch Can you please share the link to the project instead of just sharing the screenshot?
-
I did this in the first message
https://fxdreema.com/shared/X8DayNi0b -
@ennoch
Is it possible that you have created many lines with the same level ?Have you manually check the objects created on the chart?
-
It only draws one line, even if it draws multiple lines. After opening a position, the lines are deleted, and it should not open another position until a new line is drawn.
-
@ennoch
So it is really strange -
Me parece un EA muy interesante especialmente para usarlo en los Indices Sinteticos Boom1000, me gustaria ver la parte de SELL para probarlo en Crash... de momento en Boom1000 esta muy interesante esta estrategia claro hay que pulirlo mas pero esta muy bueno como inicio de un proyecto nuevo
-
Arevald is right. It should work with an 'once per object' block. If it doesn't, the only solution I imagine is remaking the whole project from scratch because the current code is corrupt for some reason. It's a small project, so it will not be a wast of time too big. On the other hand, I see no sell structure here. Is this the whole bot or just part of it? Maybe there is something conflicting this part that we cannot see.
-
@l-andorrà I just tested the buy position
I will write the code again, maybe it will be correct -
@ennoch Ok. Let us know if it was the issue.