The array sorting function used actually sorts them in the manner in which they are listed in the Pairs Array.
Perhaps a minor point but a very useful point.
I like looking at the JPY then USD then crosses in order.
So if I arrange the pairs Array in that order then that is how they are sorted.
The point being is that the script is much more powerful then just Alphabetical Sort.
Another easy change to the script is to ask for a Filename that is a current template. Minor code changes such as adding an extern variable, making Filename equal to that variable, commenting out the ChartSaveTemplate function..see below.
Code: Select all
#property show_inputs
extern string templ ="input template";
int INDEX[28];
string PAIRS[28]= {"EURUSD","AUDCHF","AUDJPY","AUDNZD","AUDUSD","CADCHF","CADJPY","CHFJPY","EURAUD","EURCAD","EURCHF","EURGBP","EURJPY","EURNZD",
"AUDCAD","GBPAUD","GBPCAD","GBPCHF","GBPJPY","GBPNZD","GBPUSD","NZDCAD","NZDCHF","NZDJPY","NZDUSD","USDCAD","USDCHF","USDJPY"};
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
ArrayInitialize(INDEX,-1);
string FileName = templ;//"temp_template"; //file name to save current template
long CurrentChart = ChartID();//get current chart ID
// ChartSaveTemplate(0, FileName);//save current template
int period=Period();
int n=0;
A truly useful script by "arts".