How to Resolve Erroneous FIFO Violation Message on My Trade Copy Signal? - page 3

 
Mahmoud Sabet:

Hi Paul...thanks for your response.  Do you  now where I can get the script:  ACCOUNT_FIFO_CLOSE?  

I believe the issue is likely either item 2 (a broker flag on the account) or item 3 (subscribers account), because once someone is connected to the trade copy, the subscribers account will receive notifications of FIFO violations from Oanda (if Oanda is their broker), but subscribers who use other brokers (such as Forex.com) have not reported this issue.

My master account is with Forex.com and I never receive notices of violation from them.  But I've seen that some potential subscribers with brokers such as Forex.com cannot start the subscription, and they receive a message that tells them this signal is not FIFO compliant. 

this script will print to the Experts log the following:

Account type

Margin Mode

FIFO status

Files:
 
Just checking if anyone was able to figure this out. I have an account with Forex.com and the person I would like to subscribe to has a USA account with IG, but then I get the same error message about FIFO compliance. Were you able to resolve this issue by any chance?
 

Close All FIFO - expert for MetaTrader 5

The Expert Advisor performs a single task immediately after launch: it closes all positions on the trading account (excluding Magic and excluding the symbol) according to the FIFO rule. As soon as all positions are deleted, the EA stops. After that, it must be manually removed from the chart.

----------------

CloseAll FIFO - script for MetaTrader 5

This free code manages to close all positions complying FIFO rules just by drag and drop into the chart, no matter if profit or loss.
CloseAll FIFO
CloseAll FIFO
  • www.mql5.com
This free code manages to close all positions just by drag and drop into a chart.
 
Meta 5 for US trading  (just one page)
Meta 5 for US trading
Meta 5 for US trading
  • 2021.08.03
  • www.mql5.com
Can anyone tell me which brokerages in US are accepting Meta 5? I am struggling to fin a broker. Thanks you...
 
richbugger: Just checking if anyone was able to figure this out.

I already posted that needs to be done (on page 1). What part of that was unclear to you?

 
William Roeder #:
  1. You say it is compliant — obviously it isn't.
  2. Just because you use a FIFO based broker that won't allow it, other brokers will reject calls with an error. Fix your broken code.
  3. On some brokers, all open tickets get the same TP/SL (including trailing) so the first open must close first as required by law rules. Other brokers do not. Fix your broken code.
  4. In the presence of multiple orders (one EA multiple charts, multiple EAs, manual trading), while you are waiting for the current operation (closing, deleting, modifying) to complete, any number of other operations on other orders could have concurrently happened and changed the position indexing:

    1. For non-FIFO (non-US brokers), (or the EA only opens one order per symbol), you can simply count down, in a position loop, and you won't miss orders. Get in the habit of always counting down.
                Loops and Closing or Deleting Orders - MQL4 programming forum
    2. For In First Out (FIFO rules — US brokers), and you (potentially) process multiple orders per symbol, you must find the earliest order (count up), close it, and on a successful operation, reprocess all positions.
                CloseOrders by FIFO Rules - Strategy Tester - MQL4 programming forum - Page 2 #16
                MetaTrader 5 platform beta build 2155: MQL5 scope, global Strategy Tester and built-in Virtual Hosting updates - Best Expert Advisors - General - MQL5 programming forum #1.11 ACCOUNT_FIFO_CLOSE

    3. and check OrderSelect in case later positions were deleted.
                What are Function return values ? How do I use them ? - MQL4 programming forum
                Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
    4. and if you (potentially) process multiple orders, must call RefreshRates() after server calls if you want to use, on the next order / server call, the Predefined Variables (Bid/Ask.) Or instead, be direction independent and just use OrderClosePrice().

Hi @William Roeder,

As you are US resident and experimented with FIFO rules, I would like to ask your opinion. I have a multi-symbols EA (can potentially trade 28 main Forex symbols), some people want to use several instances of it (with different settings of course), and the same "FIFO compliant" account. Seems to me it's pretty complex, nightly impossible, to code the EA to allow this, as even with different settings, the EA can still open a trade in same symbol, direction and size through several instances, but there is no way to guarantee the FIFO rules BETWEEN instances.

What do you think ?

 
Alain Verleyen #: What do you think ?

FIFO broke many things; SL/TP, multi-timeframe, multi-EAs, etc. The dumbest thing I ever heard.

 
William Roeder #:

FIFO broke many things; SL/TP, multi-timeframe, multi-EAs, etc. The dumbest thing I ever heard.

We agree. Thanks for your fast reply ;-)