There must be a way to work with FIFO rules.
-
Hello,
I am trying to figure out how to get my EA to work with FIFO rules. I spent a lot of time developing an EA that works great in Demo accounts but will not run properly in Live accounts. (US broker) What I want is to take 2 trades and have the first trade close on TP and the second trade run until my exit kicks in. But in my Live account, It takes 2 trades BOTH with no TP....
Previous forum suggestions:
- Use different lot sizes
- Use the pink blocks
I have tried both these suggestions but still can't get it. I have even tried to program a partial close of one trade, but that isn't working either. Can someone please take a look and see what I'm doing wrong?
https://fxdreema.com/shared/L4JJxi15d

Thank you!
PS - excerpt from broker support email
"Thanks for your email. Please note that per the US regulations you are not allowed to have multiple stops or take profit levels for an FX pair even if you have placed separate multiple trades. It is due to the FIFO closure rule which requires you to close the oldest position on the FX pair before you are able to close a newer position on the same trade. If your EA can take that into account while placing multiple trades on the same FX pair then it would be possible to trade."
-
@jjtrader The only solution I can see right now is opening both trades WITHOUT TP level. Then you create two groups, one for each open trade and then make the pink blocks to close one of them when hitting the requestes TP distance. That way the broker will not see (ie, detect) any TP level on the chart.
-
@jjtrader
Do it the way the broker asks. Close the oldest trade first. If you want to open several "double" trades, it will be more difficult.
Here is a small suggestion, but I have not tested it and not completed. -
@jjtrader
I have improved it once again. When the old trade is closed, the younger one becomes the oldest.
Well, logic should be treated just like a woman, always careful and think beforehand what you want to do. -
@rgoo Thanks! The whole "Group" concept confuses me, so showing me the through the link helps a lot!
Which example would you suggest would work better? Number 1 (2 trades both off the spread check block) or number 2 (trade 1 and trade 2 piggyback in line off the spread check block)?
Thanks again! I really appreciate your time.
JJ
-
@l-andorrà Thank you for your response. Can you please provide a link to an example of this? "Groups" are confusing to me.
Thanks again!
-
deleted because of update
-
deleted because of update
-
@rgoo Thank you RGoo! This us very helpful.
-
@jjtrader
The interesting thing about programming is that there are many ways that lead to the goal and you can program almost everything easier. I have determined a much simpler way.Even without an exact start, the EA keeps its head above water. Your strategy seems to be quite good.
You can remove the display, that was only for control.
The BE could also be helpful, but you can also delete it.