Have a look at the ArrayInsert or the ArrayCopy functions.
I got a code to get the economic calendar of the base currency and quote currency below
I want to merge the array of the base and the quote, how can i modify my code
they just insert new values instead of appending
So, why would that be a problem? You should think outside the box.
For ArrayInsert, you can insert at the beginning of an array, and for both ArrayInsert and ArrayCopy you can extend the array size and copy to the end of the original size.
Choose the method that will be most efficient for your needs.
EDIT: Depending on how you use them, you may not even need to resize the array as it automatically expands it.
EDIT2: Have a look at the example code in the documentation for both and experiment with the two functions.
Simple appending example ...
void OnStart() { string sBaseSymbols[] = { "AUD", "NZD", "EUR", "XAU" }, sQuoteSymbols[] = { "SGD", "USD", "GBP" }, sAllSymbols[]; PrintFormat( "Size: %d", ArraySize( sAllSymbols ) ); ArrayCopy( sAllSymbols, sBaseSymbols, ArraySize( sAllSymbols ) ); PrintFormat( "Size: %d", ArraySize( sAllSymbols ) ); ArrayCopy( sAllSymbols, sQuoteSymbols, ArraySize( sAllSymbols ) ); PrintFormat( "Size: %d", ArraySize( sAllSymbols ) ); };
Size: 0 Size: 4 Size: 7
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I got a code to get the economic calendar of the base currency and quote currency below
I want to merge the array of the base and the quote, how can i modify my code