Pips Away from an open price, but without the loop
-
Hello.
I am familiar with the blocks "For Each Trade" connected to "pips away from open price".
In my case, I want to add long positions everytime the price climbs X pips. The thing is I have these blocks after an "Once per Tick Block", so when I have many trades open the processing becomes heavy for the CPU.Is there a way to Check what is the TradeID ou OpenPrice value of the least profitable trade every 5 seconds, for example, and store that value, so that, every tick, we compare that value with the current price?
If so, what are the blocks involved?
In this case I would only compare two values each tick, what would be much leaner on the CPU.Thanks in advance.
-
@choppedice This structure will do exactly that for the last open trade only, so the computer will be doing far less calculations per tick:

Because there will only be a new open trade X pips above the last one, you don't need to care about any of the previous one.
-
I was taking into consideration the least profitable trade, because I am interested in adding only when all my trades are in the green.
But I guess I could filter for the newest and put a block to only open the position when there are no open positions nearby.
That makes sense, right?
Thank you so much for your input. -
Yes, that can be a valid option, but some weird results can happen if many trades are open right now and most of them are having close open prices. Be careful with that.
-

I can't understand why this is not working
@l-andorrà can you help, mate? -
Can you please share the link to the project instead of uploading the screenshot? I need to see more blocks settings.