How to locate and mark the oldest or most losable open trade as a variabel value?
-
Hi,
I am working on an Expert where I have multiple positions opened at a given time.
I want to mark the oldest and/or the most losable trade as a variable value, so I can use this marker to write new rules for the expert advisor. For example to check (realized)profits since the oldest open trade.
Does anyone know if this is possible within FXDreema? Maybe it needs custom coding?
Thanks in advance.
-
You can use a 'for each trade' blok tree searching for those specific trades and then store their ticket numbers into variables. But I dont full y understand the part for profits. Do you mean you need to know the combined profit of all open trades? That's exactly the value of current floating.
-
@l-andorrà Thanks for your reply.
I'll explain what I want to program into my EA;
- Check price of most losable trade (at any time of all open trades)
- Check the realizied profits from all closed orders that have closed after the most losable trade OR oldest trade open
- If realized profits - value of most losable trade => minimum profit target; than close most losable trade
So I am targeting a single trade to close, instead of a bucket of trades.
Hope this makes more sense what I want to achieve with this trade management rule.
-
That is a more complex loob because we can never know when the most losable trade was closed. I guess ou will need custom code to do that because the only way I know to do it is via arrays storing the info of the ticket number for that specific trade. I'm afraid that goes beyond my capabilities, sorry.