Hello all,
I have developed a code in the Future mode which involved two different time frames and Foreign function. Let's assume that the original code is in M15 and now I switch to hourly time frame to get EURUSD Open and Close in the hourly time frame, do some math and expand it back to M15:
Sorry, I forgot to add that if I want to use SetForegin multiple times, do I need to use TimeFrameRestore() as well every time or in the final stage. What about TimeFrameSet()?
I want to get open and close of AUDUSD, EURUSD and GBPUSD in the hourly timeframe and expand it to the original time frame (for example M15).
Does the below combination of SetForeign and TimeFrameSet works?
SetForeign("AUDUSD");
TimeFrameSet(inHourly);
AUD = (C-O)/(C+O);
SetForeign( "EURUSD" );
EUR = (C-O)/(C+O);
SetForeign( "GBPUSD" );
GBP = (C-O)/(C+O);
TimeFrameRestore();
RestorePriceArrays() // Does this restore it to the previous step or to the original before the first SetForeign?
AUD = TimeFrameExpand( AUD, inHourly);
EUR = TimeFrameExpand( EUR, inHourly);
GBP = TimeFrameExpand( GBP, inHourly);
or I need to use the following order for each pair?