Spécifications
The MFI here is the Market Facilitation Index. Job is very simple. Track the last 4 MFI values and colours. There are 4 MFI colours (check attached image for reference) - Green, Brown, Blue, Pink. There will be a tracking sequence. The sequence will receive colours as inputs (you can represent this however is easy for you), separated by `0`. Multiple sequences are needed, so it will be seperated by a comma. When a sequence is found, open the specified trade.
Variables:
Period - an integer specifying how many mfi colours should be tracked. Default is 4, but could be more or less.
Sequence - tracks any sequence. It will receive the full colours needed, separated by `0`.
trade type - buy/sell
lot size - int/float
sl - in pips, if set to 0, do not use
tp - in pips, if set to 0, do not use
clock - integer indicating how long should trade open for in minutes e.g when set to 10, close trade after 10 mins if sl or tp is not hit. If set to 0, do not use.
Examples:
1. Period is set to 4 and we need to track 1st and 4th colours, it will receive input like `Gr00Bl` - the two zeros in the middle represent the 2nd and 3rd colours which we have no need for. So 1st colour is green, 4th colour is blue.
2. Period is set to 4 and we need to track 2nd and 4th colours, it will receive input like `0Gr0Bl` - the two zeros represent the 1st and 3rd colours which we have no need for. So 2nd colour is green, 4th colour is blue.
3. Period is set to 6 and we need to track 3rd, 4th and 5th colours, it will receive input like `00GrBrBl0` - the three zeros represent the 1st, 2nd and 6th colours which we have no need for. So 3rd colour is green, 4th colour is brown and, 5th colour is blue.For tracking multiple sequence, the input will be seperated by comma like this - `Gr00Bl,0Gr0Bl` - so there are two sequences being checked for here. There can be 10 or more sequences.
If you have a better idea of how to represent the input, no problem, as long as it does the same thing. NB: since MFI is drawn at the close of a candle, so you're always checking when the present candle closes, so a trade can be opened on the new candle. There might be improvements of this EA with additiion of an extra indicator, but this is the first stage. Thanks.