Why is the logic that difficult, on candle open and trade is in profit. Close position.
Anyone have an easier solution that using time filters?
Why is the logic that difficult, on candle open and trade is in profit. Close position.
Anyone have an easier solution that using time filters?
@kevdiaz
I too have been trying to figure out, on candle open, take profit. But unfortunately, sometimes the next candle is a very small one and while it may seem "profitable," when you add commission, spread, and if there are any fees the candle open won't be making profit.
So there must be more rules to (mostly depending on time frame you are selecting) if you want to close in this way.
The way I did it with my daily time frame strategy is,
-Time filter, start 00:00; end 00:01
-If Position
-Close profitable positions( over 1 pip and older than 5 minutes).
In the "close profitable positions" block, there is a selection for age. I suspect you could use that for your strategy as well depending on the time frame you are using. Just adjust the time filter to match when you need it.
There are many ways to do it, thats what I did for a daily time frame.
En Espanol
Yo también he estado tratando de averiguar, con la vela abierta, obtener ganancias. Pero, desafortunadamente, a veces la próxima vela es muy pequeña y, si bien puede parecer "rentable", cuando agrega comisión, margen y si hay alguna tarifa, la vela abierta no generará ganancias.
Por lo tanto, debe haber más reglas (principalmente dependiendo del período de tiempo que esté seleccionando) si desea cerrar de esta manera.
La forma en que lo hice con mi estrategia de marco de tiempo diario es,
-Filtro de tiempo, inicio 00:00; final 00:01
-Si posición
-Cerrar posiciones rentables (más de 1 pip y más de 5 minutos).
En el bloque "cerrar posiciones rentables", hay una selección por edad. Sospecho que también podrías usar eso para tu estrategia dependiendo del marco de tiempo que estés usando. Simplemente ajuste el filtro de tiempo para que coincida cuando lo necesite.
Hay muchas formas de hacerlo, eso es lo que hice durante un período de tiempo diario.

try adding a once per bar in between the time filters, and splitting the tree to be totally separate in buys and sells.
As for the trailing stop, place that under a 'if position'. Maybe that will achieve the goal
the logic doesnt make sense, if you want it at the same level then its not pending at it will open 2 trades at the same time. "
If this is the case, then just put both blocks side by side connected down from the final condition telling you to enter the trade.
@tashab they'll find out that it just becomes this continual loop because the market wont continue to cycle as much as theyre expecting and then all the sudden youve got 50 open trades and the problem just continues to exacerbate itself.
@ozzkamana in the bottom of each pending order block is an option to check "OCO." One cancels other.
Is that what you need?
then the logic from the top is; if no position it will seek to get into a position starting with the condition block below it because orange is the true side. If no position is false (yellow side), trail stop trades.
Please share the project link and I can help further. 2 trail blocks, 1 for B and 1 for S is for the most part unnecessary.
are you trail is the best one for this scenario? maybe it likes straight up pips better? maybe an ATR close? possibly a break even?
move the time filter above once per bar.
Remove if position and replace it with, "if no position."
take trail stops off and move it to the yellow connection off of "If no position"
remove every N bars.
disconnect the "condition" block from the yellow one and connect only to the orange of, if no position.
That should clear up some of your issues
@miro1360 4 years later still helping a brother out. 1 more upvote for Miro!
Id put my eyes to the (OnTrade) tab at the top. There are more specific blocks available to OnTrade actions. @raveon

there are blue cotrolling blocks, no-position, if position...whichever you need
for an indicator like RSI, first Id suggest tossing the indicator. But if you must use it, C1 (candle 1) is probably what you're looking for.
try to specify a candle ID.
0 is current, 1 is the last one, 2 is two before the current as so on.
are yoiu using custom code blocks by chance?
@l-andorrà I meant, with "if position/Order" and without.
As @jstap said, those are just bools but those aren't the blocks in question