Try this:
int MyClose= CopyClose(Symbol(),TIME_FRAME, start_copy, Time_Be_Counted, Close_Array); // 'Close_Array' - array required
Hello again,
Thank you sir, some more help required please.
From my own experience. There appears to be a more technical approach to reading data. Regardless of experience, or knowledge.
int slippage=int((Ask-Bid)*0.18/_Point);
The above was found on MQL forum. To me this reads as slippage = spread * factor/points.
Now the "factor" bit has stumped me.
int slippage=int((Ask-Bid)*Magnitude/_Point);
Now where I put ( multiply Magnitude / _point);
Basically, I am still struggling with the meaning behind slippage.
Hello again,
I have been trying to work on Correlations lately, but I have already run into my first problem. The first "AUD_Symbols()" works fine. I tried to change the code to make an array
"string AUD_Symbols[]={"AUDUSD","AUDCAD","AUDNZD","AUDCHF","AUDJPY"};" . How would I be able to run the for loop on the first array until its finished writing to the first "AUD_Symbols_Close"..etc?
Afterwards count backwards or forwards on the string "AUD_Symbols[]={"AUDUSD","AUDCAD","AUDNZD","AUDCHF","AUDJPY"};".
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void AUD_Symbols() { for(i=0; i<50; i++) { Chart_ID = ChartOpen ("AUDUSD",TIME_FRAME); MyClose = CopyClose ("AUDUSD",TIME_FRAME,0,i, AUD_Symbols_Close); MyOpen = CopyOpen ("AUDUSD",TIME_FRAME,0,i, AUD_Symbols_Open); MyHigh = CopyHigh ("AUDUSD",TIME_FRAME,0,i, AUD_Symbols_High); MyLow = CopyLow ("AUDUSD",TIME_FRAME,0,i, AUD_Symbols_Low); MyTime = CopyTime ("AUDUSD",TIME_FRAME,0,i, AUD_Symbols_Time); } } //+------------------------------------------------------------------+ //| AUD_Symbols[]={"AUDUSD","AUDCAD","AUDNZD","AUDCHF","AUDJPY"}; | //+------------------------------------------------------------------+ void AUD_Symbols() { int x=ArraySize(AUD_Symbols); AUD_Symbols[x]=SymbolName(x,true); for(i=0; i<50; i++) { Chart_ID = ChartOpen (AUD_Symbols[x],TIME_FRAME); MyClose = CopyClose (AUD_Symbols[x],TIME_FRAME,0,i, AUD_Symbols_Close); MyOpen = CopyOpen (AUD_Symbols[x],TIME_FRAME,0,i, AUD_Symbols_Open); MyHigh = CopyHigh (AUD_Symbols[x],TIME_FRAME,0,i, AUD_Symbols_High); MyLow = CopyLow (AUD_Symbols[x],TIME_FRAME,0,i, AUD_Symbols_Low); MyTime = CopyTime (AUD_Symbols[x],TIME_FRAME,0,i, AUD_Symbols_Time); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+
string symbols[]; ArrayResize(symbols,SymbolsTotal(1),0); //--- pre-loader for(int i=0;i<SymbolsTotal(1);i++) { symbols[i]=SymbolName(i,1); } //--- re-loader for(int i=0;i<SymbolsTotal(1);i++) { Print("SYMBOL: ",symbols[i]," Found At: ",i); // Do Something for symbol[i]... }
Also you can use:
iOpen(symbols[i],PERIOD_CURRENT,bar); iHigh(symbols[i],PERIOD_CURRENT,bar); iLow(symbols[i],PERIOD_CURRENT,bar); iClose(symbols[i],PERIOD_CURRENT,bar); iTime(symbols[i],PERIOD_CURRENT,bar);
Etc...
Hello friends,
I am still struggling with this code. I keep on getting array out of range error. I know why it happens, but I am a bit lost as to how to make AUD only increment after "I" is >= to 10 and not leave the for loop until AUD = x
Anyone with some new ideas to make this possible ?
void AUD_Symbols() { int x=ArraySize(AUD_Symbols); // x = 5 for(i = 0; i < 10; i++) { AUD_Symbols[AUD]=SymbolName(AUD,true); Chart_ID = ChartOpen (AUD_Symbols[AUD],TIME_FRAME); MyClose = CopyClose (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Close); MyOpen = CopyOpen (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Open); MyHigh = CopyHigh (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_High); MyLow = CopyLow (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Low); if(i <= 10 ) AUD++; continue; } }
Hello again,
I came up with this code. It sort of does the trick, but is badly floored in its execution.
int AUD_Symbols() { int x=ArraySize(AUD_Symbols); ArrayResize(AUD_Symbols,x); for(i = 0; i < COUNT_TO; i++) { AUD_Symbols[AUD]=SymbolName(AUD,true); MyClose = CopyClose (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Close); MyOpen = CopyOpen (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Open); MyHigh = CopyHigh (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_High); MyLow = CopyLow (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Low); MyTime = CopyTime (AUD_Symbols[AUD],TIME_FRAME,0,i, AUD_Symbols_Time); continue; } AUD++; return(AUD); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I don't don't understand the error I get. The error always points to this area