I have a question which should be an easy one for good coders.
In “MPTM is trading multiple pairs”, I am trying to add a filter to avoid trading a selected list of pairs. I think it is possible to manage that with an extern string and an array which should look like this:
Code: Select all
extern string ExcludedPairs ="AUDCAD,AUDCHF,AUDNZD, CADCHF, CHFJPY ";
… code to manage the excluded pairs as an array.Code: Select all
extern bool ExcludePairs = true;
extern string ExclusePair101 ="AUDCAD";
extern string ExclusePair102 ="AUDCHF";
extern string ExclusePair103 ="AUDNZD";
extern string ExclusePair104 ="CADCHF";
extern string ExclusePair105 ="CHFJPY";
void Strategy(string symbol)
{
//...
if (ExcludePairs)
{
if (StringCompare(symbol, ExclusePair101)==0) CheckExcludePair = exclude;
if (StringCompare(symbol, ExclusePair102)==0) CheckExcludePair = exclude;
if (StringCompare(symbol, ExclusePair103)==0) CheckExcludePair = exclude;
if (StringCompare(symbol, ExclusePair104)==0) CheckExcludePair = exclude;
if (StringCompare(symbol, ExclusePair105)==0) CheckExcludePair = exclude;
}
}Any help would be appreciated, for “MPTM is trading multiple pairs”, and for me to understand how to build and use arrays.
Thanks for your help.
Cheers,
Gringoh