Topic: FIFO Rule

In the USA traders have to obey the FIFO rule.  The rule says I can have only one asset open at a time that has the same lot size.  So for example lets say my EA wants to open more than one instance of EURUSD with lot size 1.0.  If one instance of EURUSD lot size 1.0 is open and the EA wants to open a second instance of EURUSD lot size 1.0 I will get a FIFO violation message and the second instance of EURUSD will not be open.  However, it is not a FIFO violation if another EURUSD is open with a different lot size.   I was looking through all the indicators and I found one indicator "Enter Once" that would allow only one instance of an asset open for once a bar, once a day, once week, once a month, however this does not meet the FIFO requirement.  What I need is a signal within the EA to only let the EA enter one instance of an asset to be opened at one time and reject a second instance of the asset that is trying to open another position if the lot size is the same, and then when the asset is closed the signal would allow another instance of the same asset with the same lot size to be opened.  Does anyone have any idea's on how to do this, if so I am all ears?

Re: FIFO Rule

The Expert Advisors created with FSB Pro follow the FIFO rules when your strategy deals with multiple positions.
However, this works on a single expert.

You cannot effectively trade with multiple experts in USA. The reason is that if there are multiple open positions per symbol, all experts, except the first one that entered could not close their positions. This breaks the trading rules of the strategies.

Your possibilities are:
- trade one expert per symbol,
- find a broker that does not apply FIFO rules.

3 (edited by Alann 2023-03-20 23:08:40)

Re: FIFO Rule

Popov wrote:

The Expert Advisors created with FSB Pro follow the FIFO rules when your strategy deals with multiple positions.
However, this works on a single expert.

You cannot effectively trade with multiple experts in USA. The reason is that if there are multiple open positions per symbol, all experts, except the first one that entered could not close their positions. This breaks the trading rules of the strategies.

Your possibilities are:
- trade one expert per symbol,
- find a broker that does not apply FIFO rules.

Please review the FIFO rules as per this link:

https://oanda.secure.force.com/helpportalhome?
language=en_US&when=1679061769444#!/article/kA04O000000LXeMSAW/ka04O0000001H1JQAU/

See examples 1,2,3, and 4.

As per the FIFO rules I can trade multiple instances of the same asset i.e. EURUSD for example as long as the lot size is different.

To trade EURUSD with lot size 1.0 multiple times each day I must wait until the open position is closed, then I can enter another position of EURUSD with lot size 1.0. 

I have been doing this with my Oanda.com demo account.  The only time I get a FIFO violation is when the EA's try to open a second position with the same lot size when one is already open.  Now I would like to implement this strategy with an EA so I don't get these violations.

Post's attachments

Screenshot 2023-03-20 170306.png 144.67 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: FIFO Rule

If the different lot size solves the problem, why don't you set your experts with entry: 1.01, 1.02, ...

Re: FIFO Rule

Popov wrote:

If the different lot size solves the problem, why don't you set your experts with entry: 1.01, 1.02, ...

Yes this is what I do.  However, there is still one FIFO violation that occurs.  For example:  If I have an EA for EURUSD with lot size 1.01 open and the same EA with the same magic number wants to open a second position I get a FIFO violation.  What I was wanting to do is to keep this second position from trying to open so I don't get the FIFO violation.

Re: FIFO Rule

> What I was wanting to do is to keep this second position from trying to open

This sounds strange to me.
What if you use: Next same direction signal - Nothing
The strategy will not add to the position.

Re: FIFO Rule

Popov wrote:

> What I was wanting to do is to keep this second position from trying to open

This sounds strange to me.
What if you use: Next same direction signal - Nothing
The strategy will not add to the position.

"This sounds strange to me."  Example 1 (see attachment) explains this fifo violation.
"What if you use: Next same direction signal - Nothing" This is most likely the answer I have been looking for!

Post's attachments

Screenshot 2023-03-21 080458.png
Screenshot 2023-03-21 080458.png 36.74 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: FIFO Rule

A strategy will not open an additional position without telling it to do so.

Please check the "Next same direction signal" option. It must be "Nothing" in your case.

9 (edited by Alann 2023-03-23 11:11:33)

Re: FIFO Rule

I have been testing four EA's with the "nothing" option selected.  So far so good!

Here is what I am expecting to happen.  For example, if I have two EA's for EURUSD and two EA's for USDJPY I am expecting the "Nothing" option to only allow one instance of each EA for EURUSD to open a trade on only one instance of each EA for USDJPY to open a trade.

Right now I have one instance of each EA for EURUSD with open trades but the EA's for USDJPY have not yet opened any trades.

Re: FIFO Rule

Do you have a unique Magic number" for each strategy?
This is the way the expert distinguishes its trades.

11 (edited by Alann 2023-03-23 15:22:58)

Re: FIFO Rule

Popov wrote:

Do you have a unique Magic number" for each strategy?
This is the way the expert distinguishes its trades.

Yes!

Thanks for clarifying.  I was wondering if it used the magic numbers.

I think I now have my FIFO strategy all set up.  It should now obey all FIFO rules in the USA and it should now start to open trades 2 hours after the market opens to avoid high spreads.  It should not open any new trades 4 hours before the market closes.  It should also close all trades 10 minutes before the market closes to avoid high swaps.  I will now test this strategy to make sure it is working as expected.