FIFO Settings

I need a way to have the EAs operate in US FIFO fashion.  Currently they operate in a hedge fashion, and I get trades in both directions at times in the backtesting.  Using a stop loss for all of the EAs, this is not a frequent occurrence, but it is often enough to make the results suspect.  Please either create a way to make the strategies FIFO compliant or point me to the way to the settings that will do so.
Attachments
No attachments
  • Votes +5
  • Project StrategyQuant X
  • Type Feature
  • Status Archived
  • Priority Normal
  • Assignee None
  • Milestone Archived (To be done later)

History

TD
#1

Timbeaux

24.12.2018 19:51

Task created

Tt
#2

tactevo

06.01.2019 02:13
Voted for this task.
MC
#3

Michael47x

27.04.2019 05:22
Voted for this task.
KL
#4

kainc301

01.11.2019 17:09
Please definitely add this when there is time to implement.
KL
#5

kainc301

01.11.2019 17:09
Voted for this task.
KL
#6

kainc301

01.11.2019 19:23
I added some commentary regarding this in this thread https://strategyquant.com/forum/topic/enforcing-fifo-rules-in-combined-strategies/#post-250155


I believe this should be relatively simple to implement and would only require two basic rules for implementation.


1. While a trade is open (an order was filled), prevent any further orders (limit or market orders from either side) from being submitted.

2. Stop limit and limit orders from either side can be submitted simultaneously as long as no trade is open however, when a trade is open (an order was filled), cancel any pending limit/stop limit orders that did not originate from the open trade.


This should be able to be backtested as well/enabled the EA for MT4/Multicharts/etc. Also, It may be obvious but when cancelling limit/stop limit orders, this should only apply to other trades and not the TP/SL of the current trade.

KL
#7

kainc301

14.12.2019 05:18
Also, there is an easy test to confirm this is working properly once implemented:


Loop through the orders. Check if the time of opening the next trade only occurs after previous trade is closed out. Should be true for all trades recorded by the strategy.

KL
#8

kainc301

26.12.2019 17:13
This should be obvious but I want to add in order to make clear. FIFO should only be applied individually to strategies and shouldn't conflict between multiple strategies. For example, if FIFO mode is enabled on a EUR/USD strategy and a AUD/USD strategy, the EU strategy should not have to check if positions are closed on AU strategy in order to trade. It would only check if there are no positions open on the individual strategy trading EU in order to determine whether to trade or not. This would also be the same case if two strategies traded the same instrument. 
MF
#9

Mark Fric

16.02.2020 13:52

Status changed from New to Archived

m
#10

murty

13.03.2020 17:05
Voted for this task.
k
#11

Karish

11.09.2020 18:57
Voted for this task.

Votes: +5

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please